Re: users with shutdown priviledge (211 Views)
Reply
Regular Advisor
Tuan Nguyen
Posts: 120
Registered: ‎12-27-2004
Message 1 of 9 (211 Views)
Accepted Solution

users with shutdown priviledge

Hi,

I am setting NIS users up with shutdown priviledges, however, when user executes SAM and selects shutdown, the system gives this error message:

Unexpected Exit: process ( trap "" 27 28; /usr/sbin/sync; cd /; /usr/sbin/shutdown -y -r 60 > /dev/console 2> /dev/null) exited with a non-zero exit status

The system could not be rebooted because of the following reason: The command "(trap "" 27 28; /usr/sbin/sync; cd /; /usr/sbin/shutdown -y -r 60> /dev/console 2>/dev/null)" failed.

How do I fix this?

Thank you very much for your help.

Tuan Nguyen
Honored Contributor
Peter Godron
Posts: 4,470
Registered: ‎02-13-2002
Message 2 of 9 (211 Views)

Re: users with shutdown priviledge

Tuan,
have a look at your shutdown.allow file.
Are root and the users defined? Or is the file empty?
Regards
Honored Contributor
RAC_1
Posts: 5,920
Registered: ‎03-21-2002
Message 3 of 9 (211 Views)

Re: users with shutdown priviledge

trap "" 27 28; /usr/sbin/sync; cd /; /usr/sbin/shutdown -y -r 60 > /dev/console 2> /dev/null

One of the above command is failing and that is causing a problem.
There is no substitute to HARDWORK
Regular Advisor
Tuan Nguyen
Posts: 120
Registered: ‎12-27-2004
Message 4 of 9 (211 Views)

Re: users with shutdown priviledge

Peter,

Thank you for your quick response.
The shutdown.allow has the hostname and the username.
Ex:

cam13 tuan

tuan
Regular Advisor
Tuan Nguyen
Posts: 120
Registered: ‎12-27-2004
Message 5 of 9 (211 Views)

Re: users with shutdown priviledge

RAC,

Thank you for your quick response.

Do I need to execute these command manually and see why they failed? All these commands are for root only, I don not know if I can exexute them as user.

Tuan
Honored Contributor
Peter Godron
Posts: 4,470
Registered: ‎02-13-2002
Message 6 of 9 (211 Views)

Re: users with shutdown priviledge

Tuan,
try executing the individual commands as the NIS user. Should the users also be in the shutdown.allow file (we are not running NIS)?
Regards
Honored Contributor
RAC_1
Posts: 5,920
Registered: ‎03-21-2002
Message 7 of 9 (211 Views)

Re: users with shutdown priviledge

trap "" 27 28; /usr/sbin/sync; cd /; /usr/sbin/shutdown -y -r 60> /dev/console 2>/dev/null

Just redirect error (2 > /tmp/error.log) This would give info on what is failing.

Anil
There is no substitute to HARDWORK
Regular Advisor
Tuan Nguyen
Posts: 120
Registered: ‎12-27-2004
Message 8 of 9 (211 Views)

Re: users with shutdown priviledge

Peter, RAC,

I am able to run /usr/sbin/shutdown -y -r at the command line as user now. Thank you very much for your help. I really appreciate it.

Tuan
Honored Contributor
RAC_1
Posts: 5,920
Registered: ‎03-21-2002
Message 9 of 9 (211 Views)

Re: users with shutdown priviledge

For every command that you use, add >> /tmp/error.log 2>&1 and check error.log file for errors.

You will have to remove 2>/dev/null

Anil
There is no substitute to HARDWORK
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.