I am trying to change user in order to execute a specific command during startup. It fails silently and apparently the userchange isn't carried out as I can tell that the command isn't executed.
What am I doing wrong in my below shown initscript?
respawn
console none
start on startup
stop on shutdown
script
su -u anotheruser -c "myCommand" >> "myLogfile.log"
end script
I wrote a script that suspend all my virtualbox machines, and put a line in /etc/rc.local.shutdown, but it doesn't seem to work,
su - XX -c /XX
When I'm booted next time, virtualbox tells me the machine was Aborted, so the script wasn't executed. (Launching that script manually works for me)
P.S I already enabled shutdown.target
i need to put a startup script to my Centos6 server.
I see that i need a script that contains start-stop cases.
But i have a problem to make it and neither how to put this script to startup.
Anyone can say me how can i add it?
The script must run a simply command that run a jar file:
java -jar FileName.jar
Thank you all
I want to create to deploy a heartbeat service (a python script) as a service using Upstart.
My understanding is that I've to add a /etc/init/myheartbeatservice.conf with the following contents.
Hi Guys,
Good day ULF! Can you assist me in creating a script that will email once an error has occurred. It's like this, I have script that is used for monitoring, distinct keywords on the status are OK and Error respectively. Then I created another script that will call for the monitoring script to run so that the new script will save an output into a file.
The GPO Startup scripts works fine on other machine but not for another half of the machine. gpresult show that GPO was there. I ran RSOP and it show that the Startup script was there but it was never executed.
Hi,
Im trying to run script A which requires path /sbin.
I have a crontab entry to run script A every 10 minutes.
Script A is executed fine by cron, but because script A requires /sbin in its path it fails to run.
My situation is script A get overwritten from time to time so I can't modify script A to set path in there.
So my question is...
I'm trying to set up Virtualbox to run as a service so that it auto starts the VM when the PC boots and shuts down the VM when the PC is shut down.
I've found a set of scripts that do this but set up of the scripts was written for Ubuntu so I'm stuck at one of the steps.
The set of scripts can be found HERE
The part of the install that I'm not sure about is the part in bold.
When i do: sudo sh /etc/rc.local it works perfect but when i reboot my system, it wont start.
There is my rc.local file:
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.