linux startup script for my application
Hi Experts,
I have a script that is store in a directory /data/software/power.sh and this is suppose to be running as the user pwview who owns the directory and belongs to the group users that owns the directory. I need the user pwview to start the script /data/software/power.sh everytime my server is rebooted or shutdown currently I have to manually change to that directory and execute the script ./power.sh as the user pwview and I need this automated by a script that will start the service as the user. I will highly appreciate a scritp and where this should be that will execute my script when ever my server is booted or after a shutdown. |
You can create a script like this:
Code:
#!/bin/sh If you're using redhat as in your profile you can just add an entry in /etc/rc.d/rc.local like: Code:
/path/to/my-script |
Where should my script be locate e.g. /etc/init.d/
Thanks |
You didn't say your distro.
If it's using rc.local (like RH, fedora, Slackware), the script can be located everywhere. You just add a line in rc.local containing the full path to the script. The same goes for Suse and the file /etc/init.d/boot.local. For others you have to look how they run startup scripts. Regards |
All times are GMT -5. The time now is 10:08 AM. |