Sponsored Content
Top Forums Shell Programming and Scripting Issue with shutdown command in script (MacOS High Sierra) Post 303032207 by Corona688 on Wednesday 13th of March 2019 06:28:57 PM
Old 03-13-2019
Why are you feeding a function which calls sudo, into sudo? And then you don't even use it, just call it outside sudo afterwards.

Further, you really shouldn't be editing /etc/sudoers like that. sudo on most systems will refuse to operate after /etc/sudoers has been edited by anything but visudo.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to force Oracle database shutdown when shutdown immediate does not work

I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS). Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and... (7 Replies)
Discussion started by: aixhp
7 Replies

2. High Performance Computing

High Performance Linpack Compiling Issue

I'm trying to compile Linpack on a Ubuntu cluster. I'm running MPI. I've modified the following values to fit my system TOPdir MPdir LAlib CC LINKER. When compiling I get the following error: (the error is at the end, the other errors in between are because I've ran the script several times so... (0 Replies)
Discussion started by: JPJPJPJP
0 Replies

3. Shell Programming and Scripting

what would a script include to find CPU's %system time high and user time high?

Hi , I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :( . how to find cpu's system high time and user time high in a script?? thanks , help would be appreciated ! :) (9 Replies)
Discussion started by: sushwey
9 Replies

4. Shell Programming and Scripting

Exit script when shutdown or reboot command is given

This is probably a simple question, but I'm new with writing scripts for Linux (IPFire in this case) and Google wasn't helpful with this. When creating a script, what is the best and/or proper way to have it exit automatically if the reboot or shutdown command is given? If that's even... (2 Replies)
Discussion started by: bartgrefte
2 Replies

5. UNIX for Beginners Questions & Answers

Capture power button press on MacOs High Sierra?

Hello everyone! I'm developing a MacOs Application in python and I'm having some issues trying to find information related to the power button pressed event. I know that in Ubuntu 14.04 you can find information about it on the acpi folders, but I realized that here in Mac that process is... (0 Replies)
Discussion started by: xedge
0 Replies

6. OS X (Apple)

If you run macOS High Sierra version 10.13.1, be sure to install today's update.

Some hackers found a security hole in macOS High Sierra and tweeted it to the world before telling Apple about the problem. You can see the details from PC Magazine's daily news here: Apple Releases Fix for MacOS High Sierra 'Root' Bug. The original story this morning was published before a patch... (6 Replies)
Discussion started by: Don Cragun
6 Replies

7. UNIX for Beginners Questions & Answers

Linux SuSE SLES 8 error..unable to issue shutdown command

the only way we can power off is if we actually press power button on server. Running on HP DL-G4. from root, when we issue command it just returns to root prompt. (1 Reply)
Discussion started by: amexboy
1 Replies

8. Shell Programming and Scripting

Issue with pwd for script run by double click on script (MacOS High SIerra)

Hello, I have the following script that just archives and clears some log files. #!/bin/bash # script: archive_logs_and_clear # add date to logfile names and copy archive directory # clear logs # change to script directory cd ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

9. Shell Programming and Scripting

Terminal running bash/rsync script does not close with exit (MacOS High SIerra)

Hello, I am running a bash script to do an rsync back on a computer running MacOS High Sierra. This is the script I am using, #!/bin/bash # main backup location, trailing slash included backup_loc="/Volumes/Archive_Volume/00_macos_backup/" # generic backup function function backup {... (12 Replies)
Discussion started by: LMHmedchem
12 Replies

10. OS X (Apple)

Change Name of Bluetooth Device from Command Line in macOS

Mac Version 10.15.2 (macOS Catalina) Does anyone know how to change the name of a connected bluetooth device from the command line on macOS? I am having trouble with various bluetooth devices which I cannot get the "rename" option in the GUI to "save" properly and so I cannot rename a few... (0 Replies)
Discussion started by: Neo
0 Replies
SYSTEMD-RC-LOCAL-GENERATOR(8)				    systemd-rc-local-generator				     SYSTEMD-RC-LOCAL-GENERATOR(8)

NAME
systemd-rc-local-generator - Compatibility generator for starting /etc/rc.local and /usr/sbin/halt.local during boot and shutdown SYNOPSIS
/lib/systemd/system-generators/systemd-rc-local-generator DESCRIPTION
systemd-rc-local-generator is a generator that checks whether /etc/rc.local exists and is executable, and if it is pulls the rc-local.service unit into the boot process. This unit is responsible for running this script during late boot. Note that the script will be run with slightly different semantics than the original System V version, which was run "last" in the boot process, which is a concept that does not translate to systemd. The script is run after network.target, but in parallel with most other regular system services. systemd-rc-local-generator also checks whether /usr/sbin/halt.local exists and is executable, and if it is pulls the halt-local.service unit into the shutdown process. This unit is responsible for running this script during later shutdown. Support for both /etc/rc.local and /usr/sbin/halt.local is provided for compatibility with specific System V systems only. However, it is strongly recommended to avoid making use of these scripts today, and instead provide proper unit files with appropriate dependencies for any scripts to run during the boot or shutdown processes. systemd-rc-local-generator implements systemd.generator(7). SEE ALSO
systemd(1), systemctl(1) systemd 237 SYSTEMD-RC-LOCAL-GENERATOR(8)
All times are GMT -4. The time now is 08:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy