Tag Info

New answers tagged

0

simple and clear examples here: https://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/


0

The problem doesn't seem to occur in Trusty. So it seems to be fixed.


0

I know this question is pretty old, but I think it is as relevant today as it was in 2012, and hopefully someone finds this code useful. I wrote the code for something I was doing, but thought I'd share it. My code is different, but the ideas are very similar to @infinity (in fact - the only reason I now know about /proc/*/root is because of his answer - ...


0

The "patched" Upstart configuration you link to is the same as the Upstart configuration that was shipped with Upstart 1.3 (from cannot get upstart to run user job), so I'd say that is the simplest way to enable user jobs.


0

Upstart, even when using setuid, does not set the HOME environment variable. weechat tries to use this variable to look up its configuration directory when -d is not specified. weechat prints Error: unable to get HOME directory in response to this problem. However, it went unlogged because weechat had nowhere to output this error except for stdout, which ...


0

I would expect you to do this with a "reload" or "restart" option from -outside- the script. See mysql and apache as an example: "service apache restart". Alter your upstart script so it has a "restart" feature and then add that as a command to "/etc/crontab". And yes, I understand this is not your intended answer but I also expect that the upstart script ...


2

No, the upstart is a init system as systemd and is very important to the system initialization. See more: Upstart - official webpage Talk:Comparison of init systems - Size and complexity


1

my guess is that one of the commands in your pre-start script is failing (mkdir probably). Try appending with "|| true" pre-start script mkdir -p /var/run/myservice || true chown -R root:root /var/run/myservice || true end script You should see a pid appear after the initctl start myservice command


0

Based on String contains in bash: job='your_job_name' job_status=$(status ${job}) if [[ ${job_status} == *running* ]] then # do whatever you need else # do whatever you need fi My first impulse was to use variation of code ImaginaryRobots provided job='your_job_name' dbus-send --system --print-reply --dest=com.ubuntu.Upstart \ ...


1

The version of Upstart in Ubuntu 10.10 has no support for the setuid stanza. When Upstart encounters a stanza it does not recognize, it refuses to acknowledge the validity of the job configuration. One solution is to upgrade to an Ubuntu version with Upstart >= 1.4. Ubuntu 12.04 has version 1.5 of Upstart, so that may be a good fit (although Trusty would ...


0

You can use the Upstart job and shell scripts in this repository: https://github.com/CameronNemo/lxc-net. To restart dnsmasq without tearing down the bridge, simply use the restart command (do not use stop then start, that will tear down the bridge). Note that you will need to migrate your configs from /etc/default/lxc-net to /etc/lxc-net.


1

Create /etc/init/killsshfs.conf file as root: # killsshfs - # # This service pkill sshfs description "pkill sshfs" start on deconfiguring-networking console log task exec /usr/bin/pkill sshfs According to upstart wiki: If you are converting a systemd service like this to an Upstart job, deconfiguring-networking should be used as a stop on event. ...


0

Assumptions: You used this PPA: ppa:transmissionbt/ppa You want to run Transmission with user: some_user and group: some_group Then do the following: Stop the Transmission Daemon: sudo service transmission-daemon stop Edit the init.d scripts sudo nano /etc/init.d/transmission-daemon ...and change USER=debian-transmission to USER=some_user Edit the ...


3

You can use the Upstart respawn feature. Use the upstart job for apache found here: https://bitbucket.org/CameronNemo/upstart-jobs/src/2090612200fa588412e3fe22aec5ba3747ae88d2/apache2.conf?at=master then just add a line that reads respawn.


2

According to upstart manual expect fork: Upstart will expect the process executed to call fork(2) exactly once. and according to comment 5 in init: job stuck with expect fork/daemon when parent reaps child bug: when you use "expect fork" or "expect daemon" combined with "script", Upstart ends up following the first spawned child whose exit status ...


0

To expand on xdissent's answer (which worked for me), here's an example script you can place in /etc/init/tomcat-stop.conf. When the tomcat service gets stopped, this script runs and cleanly shuts down Tomcat before Upstart restarts it. description "Tomcat Server shutdown script" setuid tomcat_user setgid tomcat_group chdir /usr/local/tomcat start on ...


0

I did have the same error message but with the mysql service : init: Failed to spawn mysql pre-start process: unable to granpt: No such file or directory It seems that it is caused by the /dev/pts not being mounted. In my case mounting /dev/pts with that command fixed the problem : mount devpts /dev/pts -t devpts Yet I don't have any expertise to tell ...


1

To disable for all sessions: sudo sh -c "echo manual >> /usr/share/upstart/sessions/mediascanner-2.0.conf" To disable for your user only: echo manual >> ~/.config/upstart/mediascanner-2.0.override



Top 50 recent answers are included