upstart

Ubuntu service Upstart or SystemD, Django development server as Service

删除回忆录丶 提交于 2019-12-13 03:46:33
问题 I've been working around with Python & Django Framework for a while with Ubuntu 16.01. Since I used Django with Q system (Celery) and some others Enhancement Apps. When I try to run all the apps each time, I need to run development server "{python manage.py runserver}", then running Celery Worker "{celery -A filename worker -l info}". Each time I working, it takes me minutes to enter the directory and start it up. I surf around and come up with the idea of setup it as service. Example,

upstart script for kafka

99封情书 提交于 2019-12-12 05:58:35
问题 I am using upstart script to do start kafka and zookeeper. My steps are: (1)The following is kafka-zk.conf (Put it in /etc/init/): kill timeout 300 start on runlevel [2345] stop on runlevel [06] pre-start script end script script KAFKA_HOME=/home/My/kafka/kafka_<version> exec $KAFKA_HOME/bin/zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties end script (2) Create symbol link: ln -s /lib/init/upstart-job /etc/init.d/kafka-zk (3) Run "sudo service kafka-zk start|stop" to start or

Upstart: each process on different core

与世无争的帅哥 提交于 2019-12-11 16:46:31
问题 I'm trying to use upstart to launch multiple instances of node.js - each on separate cpu core listening on different port. Launch configuration: start on startup task env NUM_WORKERS=2 script for i in `seq 1 $NUM_WORKERS` do start worker N=$i done end script Worker configuration: instance $N script export HOME="/node" echo $$ > /var/run/worker-$N.pid exec sudo -u root /usr/local/bin/node /node/server.js >> /var/log/worker-$N.sys.log 2>&1 end script How do I specify that each process should be

Upstart python script

心已入冬 提交于 2019-12-11 10:07:26
问题 I need to run code located /home/pi/Hello_on_startup.py each time RaspberryPi restarts For that I created hello.conf file in /etc/init/ directory description "A script controlled by upstart" author "Anton" start on runlevel [2345] stop on runlevel [016] respawn exec /home/pi/Hello_on_startup.py` When I run command sudo start hello I get an answer Unknown job: hello 回答1: You need a script...end script block in your conf file for it to be recognised, as shown here. Your resulting hello.conf

Can't Start Golang Prog Via Upstart

橙三吉。 提交于 2019-12-11 01:57:02
问题 I can't get my golang prog to run via upstart. Here is my proj dir-- /go /src /print.io /geo main.go /geodomain [.. files ..] I have my gopath set to the /go dir above. Within the /geo folder i can run go run main.go and it works. However, with the following upstart configuration its logging main.go:8:2: import "print.io/geodomain": cannot find package -- Why doesnt it work from upstart like it does when i run the command manually? description "go-server" author "micah smith" start on (net

How to upgrade/install Upstart deamon version 1.5 on Amazon Linux

∥☆過路亽.° 提交于 2019-12-10 18:45:09
问题 I instantiate an Amazon Linux machine through EC2 service and the virtual machine already have the "Upstart" daemon, version 0.6.5, installed. How can I upgrade this package to newest version, this case the version 1.5? sudo initctl --version return: initctl (upstart 0.6.5) Copyright (C) 2010 Canonical Ltd. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 回答1: Amazon actually suggests that you

Ubuntu docker container with upstart and syslog

孤街浪徒 提交于 2019-12-10 13:38:01
问题 After searching around, I'm still confused whether you can have a docker container running Ubuntu with a working init system (upstart) and syslog , or not. I know docker containers are meant for running a single process and not a full OS, but my use case is testing a daemon on various linux distros, making sure the daemon starts, stops and restarts successfully on crashes, etc., with logging to syslog. So I'm trying to decide if I can use a docker container for this or maybe I would be better

How to write Gradle startup script

蓝咒 提交于 2019-12-08 06:11:15
问题 I have a Gradle app that I startup using ./gradlew run . This works fine, but I'm trying to deploy to an AWS instance (Ubuntu 12) and I would like the script to execute on boot. I tried writing a startup.sh file with the above command, but no dice. I've also tried adding the command to the /etc/rc.local file, but that doesn't seem to work either. Can someone give me an idea as to how to execute `./gradlew run' on startup? Thanks! 回答1: I wrote the following init script for starting gradle

daemonizing sidekiq with upstart script - is not working

大兔子大兔子 提交于 2019-12-07 22:28:41
问题 I'm trying to daemonize sidekiq using two upstart scripts following this example. Basically the workers service starts a fixed number of sidekiq services. The problem is that the sidekiq script fails at the line of code where I am starting sidekiq. I've tried to run the command directly in bash and it works fine. I tried all different commented lines and none works. So my question is what am I doing wrong? Where can I see the error messages? This is my modified sidekiq script: # /etc/init

Puma - Rails on linux // Restart when process dies

时间秒杀一切 提交于 2019-12-07 17:54:53
问题 Using puma on a rails app; it sometimes dies without any articular reason; also often dies (does not restart after being stopped) when deployed What would be a good way to monitor if the process died, and restart it right way ? Being called within a rails app; I'd be useful to have a way to defines it for any apps. I did not found any useable ways to do it (looked into systemd, other linux daemons… no success) Thanks if any feedback 回答1: You can use puma control to start/stop puma server. If