Find the answer to your Linux question:
Results 1 to 3 of 3
I have a service that when shutdown requires a username and password. I use `read` in my script to gather this info because I can't have it in the file. ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    2

    Exclamation Getting user input in a shutdown init.d

    I have a service that when shutdown requires a username and password. I use `read` in my script to gather this info because I can't have it in the file. When I run the init script by hand it will ask for the username and password and everything shutsdown properly. When I run reboot or halt I get no prompt. Is there a special way to get user input in a shutdown process?

    Thanks,
    Amos

  2. #2
    Just Joined!
    Join Date
    Nov 2008
    Posts
    29
    Amos,

    no, you cannot do this.
    the only feasible thing is to (have somebody) implement a signal catch for HUP or TERM signals so that the software can shutdown gracefully.
    Barring that, one could implement a private mangle / unmangle binary(!!) program to keep the password secret, but that can of course also be hacked by other sysads. So that doesn't really solve your security issues.
    I guess, you're left with the HUP / TERM signals. TERM is used for shutting down, normally, and HUP might be used (most often) for rereading config files.

    Regards,
    Guus

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    2

    Thumbs up

    Thanks. I ended up giving it a kill -term which seemed to shutdown correctly as long as my script wits for the lockfile to go away. I was really surprised since this software is so horrible. The prescribed way to shutdown, and the only documented way, is to go to the web control panel and click the shutdown button. I found someone who said shutdown is a webservice and that is what I was calling with curl in the script.

    Thanks,
    Amos

Posting Permissions

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