Automated On/Offline during Machine reboot/shutdown, how?
Posted in 1993
I wrote the following script and saved it in /etc/init.d/informix: ------------------------------------------------------------------- #! /sbin/sh #Tag 0x00000f00 # # startup/shutdown INFORMIX engine # $Revision: 0.1 $ case "$1" in 'start') if [ -f /usr/informix/bin/tbinit] then /usr/informix/bin/tbinit echo 'startup INFORMIX engine'>>/etc/tmp.log date >>/etc/tmp.log else echo 'file tbinit not found'>>/etc/tmp.log date >>/etc/tmp.log fi ;; 'stop') if [ -f /usr/informix/bin/tbmode ] then /usr/informix/bin/tbmode -k -y echo 'shutdown INFORMIX engine'>>/etc/tmp.log date >>/etc/tmp.log else echo 'file tbmode not found'>>/etc/tmp.log date >>/etc/tmp.log fi ;; *) ;; esac -------------------------------------------------------------------- and had /etc/rc0.d/K01informix and /etc/rc2.d/S99informix linked to it. The "stop" switch appeared to work, for I got a new "shutdown..." message and timestamp each time I shut down the machine. But the "start" switch wouldn't work, and I cannot even get the "file...not found" message. It probably doesn't matter but I even created a file /var/config/informix with "on" as its content. No luck. Any pionters are much appreciated. Thanks in advance. With Regards, Pei-yu Huang