Code: Select all
[root@hpc ~]# ls -l /root/boot_vnc.sh
-rwxrwxr-x 1 mahmood mahmood 242 Oct 8 16:13 /root/boot_vnc.sh
[root@hpc ~]# ls -l /etc/rc.d/rc.local
-rwxr-xr-x 1 root root 473 Oct 8 16:49 /etc/rc.d/rc.local
[root@hpc ~]# ls -l /etc/rc.local
lrwxrwxrwx 1 root root 13 Oct 6 13:15 /etc/rc.local -> rc.d/rc.local
[root@hpc ~]# cat /etc/rc.d/rc.local
[root@hpc mahmood]# cat /etc/rc.d/rc.local
#!/bin/bash
touch /var/lock/subsys/local
/root/boot_vnc.sh
Code: Select all
Oct 8 16:57:41 hpc systemd: Failed to start /etc/rc.d/rc.local Compatibility.
Oct 8 16:57:41 hpc systemd: Unit rc-local.service entered failed state.
Oct 8 16:57:41 hpc systemd: rc-local.service failed.
If I run the script from terminal, it works.
Code: Select all
[root@hpc ~]# cat boot_vnc.sh
#!/bin/bash
while read line; do
echo "================="
USER=`awk '{print $1}' <<<"$line"`
ID=`awk '{print $2}' <<<"$line"`
echo "starting" $USER "on :"$ID
done </root/vnc_list.txt
[root@hpc ~]# ./boot_vnc.sh
=================
starting mahmood on :1
I even tried chkconfig as below but received an error:
Code: Select all
[root@hpc ~]# chkconfig /root/boot_vnc.sh on
error reading information on service /root/boot_vnc.sh: No such file or directory
How can I debug more?