![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Xwindows wont start | frankkahle | UNIX for Advanced & Expert Users | 1 | 07-26-2007 04:29 AM |
| AIX 5.3: Start Service on System startup | dennis.kuehl | UNIX for Advanced & Expert Users | 1 | 07-25-2006 03:32 AM |
| SMC wont start | wjseaman | SUN Solaris | 0 | 11-15-2005 06:07 PM |
| how do i auto start application upon startup? | doofie | UNIX for Dummies Questions & Answers | 2 | 04-01-2004 09:20 AM |
| Apache wont start | Alpha_Harblo | UNIX for Dummies Questions & Answers | 4 | 01-02-2002 09:26 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
startup script wont start up
I've put this script in /etc/rc.d and made a symbolic link to it from S99pctb in /etc/rc.d/rc3.d but it wont start up. Anyone know why ?
This is the script: --------------------------- #!/bin/sh c=1 case "$1" in start) echo -n "starting pctb ..." > /etc/logger while [ $c -lt 10 ]; do x=`/bin/date -u +%k` y=`expr $x + 1` case $y in 0|1|2|3|4|5|6) /sbin/shutdown -h "now";; *);; esac /bin/sleep 5 done ;; stop) ;; esac -------------------------------------------------- Marcus. |
|
||||
|
if you want to shut the system down when its between 1 and 7 o'clock, you should rather make a cronjob an run it every half our
then you have a chance to stop it in case you try to start the machine for any reason in the night if you are the only person that uses this machine, rather make something like 0 0 * * * /sbin/shutdown -h now >> /etc/logger 2>&1 in /etc/crontab why do you use arguments? when you don't want to start the script simply don't run it I'm confused ^^ |
|
||||
|
Since the script only works when the system is powered up, I think he wants the system to power back off if someone happens to turn it on after he's gone home.
Two things to look for. Is the script executable? Is run level 3 your system init level. Check /etc/inittab and see what your init:3:initdefault line is set to. If the number is '2', then you aren't getting to run level 3 and the script won't run. Solaris (for example) goes through the run levels until it reaches the one set with init. So if inittab is set to run level 3, it runs through 2 running scripts and then processes scripts in 3. Linux reads the run level and goes directly to the rc directory and processes the scripts. So you need to have links in each of the directories (rc2.d and rc3.d for example). So if it's linux and the inittab is pointing to run level 5 as the initdefault, you'll need to link the script into /etc/rc5.d. Carl |
|
||||
|
May I suggest simply bringing down the network interface rather than shutting down the system? Then, in the morning, bring it back online. This, of course, does not prevent console access but, quite frankly, shutting down the box doesn't either (it just takes longer).
|
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|