I am troubleshooting a script that informs me when a system has rebooted.
The script is placed in /etc/rc3.d folder under root.
The script is as follows:
function.sh is used to send a sms to my cell number.
The problem I am facing is that when I execute the script like this : ./Script ,
it returns with the following error : syntax error at line 14: `}' unexpected
But when I rin it like : ksh -x Script , it works..... What is the issue here ?
You should specify the shell on the 1st line of the script.
Also it's not wise to put scripts directly into /etc/rc3.d
you are better off putting a chkconfig compatable script into /etc/rc.d/init.d and using chkconfig to create the required sym links
Try this scrip, save it as /etc/rc.d/init.d/stnotify
Then use chkconfig --add stnotify to install your script (it will create symbolic links for the start and stop version of the script at the required run levels).
Note the same script could be enhanced to notify you if the system is restarted, shutdown or put into single user mode.
Respected Members,
We encountered an issue during node reboot when eth1 and eth5 of bond1 were behaving unusual(both eth1 and eth5 were in unknown states and ifdown and ifup were used to rectify). Please find the messages and configuration files as below and please let me know for any other... (0 Replies)
I'm trying to figure out what circumstances would cause an Open Solaris 11.2 host to switch itself from a static to a DHCP ip address upon reboot. This has only happened once but is a cause for some concern as this machine will be part of a web server pool.
Nothing has changed on the LAN that... (2 Replies)
I'm a beginner in shell scripting and doing simple scripts for work requirement.
#!/bin/bash
for blade in `cat machines.txt`
do
rsh $blade 'reboot'
done
but when I try it with root password it's throwing error saying permission denied.We're using same root password for all... (3 Replies)
Hi ,
Everytime after reboot when user tries to start vnc below error is thrown
$ vncserver :5
Couldn't start Xvnc; trying default font path.
Please set correct fontPath in the vncserver script.
Couldn't start Xvnc process.
_XSERVTransSocketCreateListener: failed to bind listener... (7 Replies)
On my Solaris box I have to reboot some devices like below.
However I think this can be done through a script. I've create a list that contains the devices IP addresses.
Here's the logic:
Reboot 4 devices and sleep for 5mins(300s.) While the devices are rebooting, I would like to confirm... (9 Replies)
One of my X4600 server had a power loss and rebooted and now its giving me a strange problem servers internal disk controller naming has changed by itself ... the after failsafe boot md.conf file shows following c3txdx but shows internal disk at c4txdx ... what could be the reason for this and... (1 Reply)
Hi,
We are using SCO UNIX 7.1.3 and the server recently started rebooting by itself.
Do anyone know how can i create a dump or crash dump while the server rebooots?
Your quick help on this is really appreciated.
Regards,
Ravikumar R (1 Reply)
Hi,
Whenever I reboot this server remotely by using the command 'shutdown -r now' or 'reboot'. The server does not return to normal multi-user mode. It boots in single user mode.
To bring back the server, someone is required to connect via console and fire 'init 3'.
Please suggest on what... (1 Reply)
Hi all,
i have a script in /etc/init.d directory.
-rwxr-xr-x 1 root root 26 Mar 28 16:00 myscript
I need it to run when my linux reboots/startup. However is it not being executed. Do i need to put in in the rc.local directory? (1 Reply)