Find the answer to your Linux question:
Results 1 to 2 of 2
all, i was wondering whether there is a way to modify the shutdown command. the purpose is to prevent users from shutting down the system without making sure that they ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    1

    modifying shutdown command

    all,

    i was wondering whether there is a way to modify the shutdown command. the purpose is to prevent users from shutting down the system without making sure that they are on the right machine.

    the scnerio should be as follows:

    when some one type "shutdown -h now " or any of the shutdown commands, a warning message should be displayed before an action takes place some thing like :

    Are you sure you want to shutdown X machine ?

    then the user will check and then decides whether to shutdown or not.

    so basically it will be like the remove command.

    Thanks in advance.

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Quote Originally Posted by fnb00 View Post
    i was wondering whether there is a way to modify the shutdown command.
    Provided you use a free software operating system, there should be a way, as you are entitled to the source code the program was built from.

    Most distributions of GNU/Linux use "shutdown" as part of the Init-tools, to be found here:
    SysVinit | freshmeat.net
    Otherwise you obtain the sources from the distributor of your operating system which may have been altered with necessary changes to work with the OS.

    That said, it is probably easier to write a wrapper script with the same name. If the script is being called, it asks the security questions and in turn starts the "real" shutdown.
    Debian GNU/Linux -- You know you want it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...