LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-05-2006, 02:43 PM   #1
khurdp
Member
 
Registered: Dec 2002
Location: Mumbai, India
Distribution: Fedora 2, Damn small linux
Posts: 30

Rep: Reputation: 15
shutdown login in /etc/passwd


Hello,
I know I can have a shutdown login in /etc/passwd with UID 0. I have always noticed a shell like /bin/bash or /sbin/sh in the last section. I was wondering if i could have something like /sbin/shutdown -t 120 -h -F. Basically be able to pass arguments to the shutdown command. I know I can do it from a .profile but didn't want to expose a /home/shutdown directory.

Thank you,
Prasad
 
Old 01-05-2006, 05:43 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Not sure what you are after but here goes.
In /etc/passwd use this at the end /sbin/shutdown_now of the shutdown line.
Now in /sbin create a script and add the following.
Contents of /sbin/shutdown_now
Code:
#!/bin/sh
/sbin/shutdown -t 120 -h -F
Run the command ' chmod +x /sbin/shutdown_now ' to make it executable.

Hope this helps
Brian1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is shell login/passwd localizable? ricky_ds Linux - Software 2 06-29-2005 02:43 AM
Setting Passwd while shutdown emailssent Linux - Security 1 10-06-2004 10:13 PM
how do i override intial login and passwd dogma Linux - General 3 07-18-2003 04:14 PM
cannot login as root /etc/passwd mistake swenz Linux - Software 3 03-27-2003 08:41 AM
can't login (corrupt etc/passwd ?) nimrod Linux - General 4 03-01-2003 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration