[03:44] hi there. I have an upstart conf that starts up my uwsgi server and it seems that it's causing every message from uwsgi to be duplicated to syslog. If I run the script on the command line (start-stop-daemon executing uwsgi) then they don't duplicate [03:45] does anyone have any ideas on how to debug this issue? or why it would happen at all? [03:45] check how many syslog processes are running. [03:47] presumably uwsgi talks to rsyslogd which writes to /var/log/syslog. if every message is being duplicated, that could mean that either more than one rsyslogd process is running, or uwsgi is logging everything twice (multiple uwsgi instances?) [03:47] what does the output from either case look like anyway? [03:47] the terminal output from starting uwsgi i mean. [04:02] ok [04:02] so [04:02] there's only one rsyslog process [04:06] and the log looks like this http://pastebin.com/nYsYLjBf [08:32] I'm having problems with my upstart job in /etc/init, service/initctl/et al don't seem to see the job. status: Unknown job [08:32] https://www.refheap.com/5471cb430dda4d0e426aa86ab this is the script, I don't see any relevant logs in /var/log/upstart either. [08:32] is there something I've seriously misunderstood? I'm running service as root, the conf in /etc/init is owned by root:root [08:33] callen: Please try running: init-checkconf /etc/init/YOUR-JOB.conf [08:33] to verify syntax. [08:34] callen: please note upstart job configuration files are not executable scripts. Thus should not have "#!upstart", should be regular files, with ".conf" extension. [08:35] xnox: noted, I didn't have that before, it was cargo cult in the midst of my desperation to get it working. [08:35] callen: cargo cult from here http://upstart.ubuntu.com/cookbook/ [08:35] =) it's the documentation, guide and examples. [08:36] xnox: have been' [08:36] I branched out from that when it didn't work. [08:36] xnox: it doesn't like my script stanza. [08:37] callen: any hidden/non-printable characters? windows line ending? [08:38] ah bloody hell [08:38] callen: copy & pasting from the paste, validates correctly by init-checkconf here on Ubuntu. [08:39] xnox: I had a stale file remotely. [08:39] xnox: it checks out now, although it seems to be stuck on stop/waiting. [08:40] xnox: it's choking on my use of "source" [08:40] xnox: what's the proper way to inject an environment? [08:41] .? [08:43] callen: both source and '.' are the same. [08:44] callen: you have respawn set. So if you are trying to start it, and daemon exits it gets stuck respawing. I'd try removing respawns & check to see that it starts & stops correctly. [08:44] callen: check logs under /var/log/upstart/YOURJOB [08:44] xnox: it's working now. [08:45] xnox: the problem was source, using . fixed it. [08:45] must be /bin/sh [08:45] hm. ok. [08:48] xnox: I'm in good shape now, thank you so much for helping me out. [08:48] xnox: the suggestion to use init-checkconf saved my sanity :) [08:49] callen: =) no problem and your welcome. [08:49] callen: guess why it was written in the first place...... =) [15:55] can someone tell me if the following is possible in upstart: [15:55] script [15:55] # a shell file that launches a java daemon [15:55] end script [15:56] I've been through the cookbook with no luck and I'm starting to wonder if I'm thinking about this the wrong way [15:58] yes, one can do so. [15:59] codelotus: but you should be careful about how many times all of that forks and be aware of getting the expect stanza correct. [15:59] xnox: ok, thanks [15:59] codelotus: the "status yourjob" should show the same pid, as you would expect, from looking at the "main" process in ps output. [16:00] codelotus: there are examples of running java daemons here: http://upstart.ubuntu.com/cookbook/#run-a-java-application [16:00] but that's without using a shell script. [16:01] right, I was able to get that example to work, i.e. putting the java -jar … in the exec stanza [16:01] codelotus: i'd recommend to spawn as many process as needed and setup environmental variables in pre-start script / end script. And then in "script / end script" simply either source variables and do a single call to only start your app, such that you can run in foreground, or expect fork, or expect daemon. And correctly track the right pid. [16:02] codelotus: see documentation about expect http://upstart.ubuntu.com/cookbook/#expect [16:02] so it is advised not to use a single *.sh script that does all of the init work and spawns the process? [16:03] codelotus: no, because if it forks more than twice, you will not be able to track the correct PID to stop/respawn/reload/restart your daemon. [16:04] ahh, and that would be what I am doing wrong [16:04] thank you sir [16:04] codelotus: Doing it like described in the first method here http://upstart.ubuntu.com/cookbook/#run-a-java-application [16:05] codelotus: is the fastest and most reliable and secure way to run java apps under upstart. [16:05] xnox: I did it like that the first time, but then I tried to go down the exec /opt/app/myscript.sh route and began to smack my head against the wall [16:06] xnox: thank you, I'll go back to the run-a-java-application method and utilize the pre-start block [16:07] codelotus: for the pre-start see for example: http://upstart.ubuntu.com/cookbook/#post-stop in the pre-start multiple commands are executed, but the script stanza only sources variables and has the final "exec cmd..." that starts the daemon. This way the "expect fork" and "respawn" actually work correctly and restart/reload/stop work correctly as well. [16:07] (job example under that section) [16:08] i see [21:05] Can I create a user-specific upstart directory and trigger those scripts to start or stop while inside that users shell? [23:05] Diranged: yes, in saucy it's enabled by default. In raring it's optional. In quantal/precise there is a way to do it, but it was clunky and never advertised, but possible. [23:06] Diranged: see http://ifdeflinux.blogspot.co.uk/2013/04/upstart-user-sessions-in-ubuntu-raring.html [23:17] interesting [23:17] thank you.. reading