Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Interesting solution which would work except for...
In this case I am running the shutdown command remotely from a Shutdown script on a Windows server using plink. The one minute delay before it returns causes 'Shutdown Script failed'.
I'm running a basic CentOS 7 installation in virtualbox without a desktop and the shutdown command works as expected i.e.
shutdown --poweroff +1
or
shutdown -h +1
So something is different about your system.
Thanks for testing that michaelk, as that is the case I have been looking at what is specific to my system.
Looks like a user account issue, issue command as root and works ok but as any other user and the timer fails. Also now noticed when shutdown issued by root the broadcast message is displayed in terminal:
Code:
Broadcast message from root@...:
but when issued by any other user this is not displayed.
Edit:
Don't know which but it is beginning to look like users need to be part of some particular user group to allow shutdown {time} to work, any thoughts which group this might be?
Does /sbin/shutdown call some other module to do the time delay? If so this is just as if non-root users do not have permissions to call that delay module.
I should have mentioned that in order to get basic shutdown working with non-root users:
Code:
chmod +s /sbin/shutdown
Is there some other module which needs 'chmod +s' to make this work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.