/srv/irclogs.ubuntu.com/2012/04/10/#upstart.txt

Totumhi.. sorry for such a basic question.. but I'm trying to write my first upstart script, and I'm trying to decide what the most appropriate 'start on stanza' to start the program is... is there a big list of all the possible EVENT options??  : man upstart - start on EVENT [[KEY=]VALUE]... [and|or...])16:10
Totumall of the guides seem to assume this knowledge, and I cannot find anything but a handful of examples from scripts that other people have written16:11
SpamapSTotum: 'man upstart-events'16:13
SpamapSTotum: *most* regular services should just 'start on runlevel [2345]' and 'stop on runlevel [^2345]'16:13
Totumhi SpamapS.. thanks for the information, its been very helpful (and apologies for my slow feedback..! hehe) .. it makes more sense for me to use runlevels rather than as this is what I am used to.. I was only using  events as I had copied these from another script... so know the script is starting correctly now.. i'm having other issues but I will try to work these out before shouting for...16:40
Totum...more help :)16:40
marruslHmmm... what might cause mountall not to emit "filesystem"?19:15
marruslI have a situation where that's happening and so rc-sysinit doesn't run.19:18
marrusland syslog has "init: Handling filesystem/failed event"19:19
marruslbut then when you telinit 2, the sys v runs and everything seems normal.19:19
marruslI'm going to have to wait for a reproducer.   all i have is " grep "init:" /var/log/syslog.....19:21
marruslso maybe there's some obvious reason as to why "filesystem" isn't getting emitted in the full logs.19:24
marruslSpamapS, ^^ do you know the criteria for mountall to emit "filesystem"?19:25
marruslI guess this is really more of a mountall question...  omg... I just looked at man mountall19:25
marruslstill says "temporary".19:26
marrusl;-)19:26
JoeGaudetHey gues20:04
JoeGaudetguys20:04
JoeGaudetI am new to upstart, just wondering how I can make an upstart process not belong to root.20:04
JoeGaudetThat is to say, I can start / stop it with another specified user.20:04
SpamapSmarrusl: filesystem is emtited when all filesystems are mounted from /etc/fstab20:37
SpamapSmarrusl: excluding 'nowait'20:38
SpamapSmarrusl: that includes any remote filesystems.. which are only known to be remote because mountall has a big switch/case20:38
SpamapSJoeGaudet: you can actually20:54
SpamapSJoeGaudet: there's a dbus socket that non-root users can use to call initctl (which start/stop are just aliases for)20:54
SpamapSJoeGaudet: the permissions are specified on Ubuntu in /etc/dbus-1/system.d/Upstart.conf20:57
marruslSpamapS, ok.  That's about what I expected.  Thanks for the info.20:58
JoeGaudetSpamapS: So I can basically add a policy for another user in that conf file ?21:21
JoeGaudethrm21:21
SpamapSJoeGaudet: or just add that user to the admin group21:25
SpamapSJoeGaudet: oh actually there's nothing special for admin. So yeah, you'd just make another user like 'root'21:26
SpamapSJoeGaudet: almost easier to just use sudo.....21:26
JoeGaudetThis is part of a one click deploy script though21:33
JoeGaudetthat isn't run as root21:33
SpamapSJoeGaudet: so just give your one-click deploy script running user sudo access to run 'start X' or 'stop X' .. seems more straight forward than dbus permissions.21:53
JanCJoeGaudet: do you want an upstart job to run as non-root, do you want to install an upstart job as non-root or do you want to start/stop an upstart job as non-root?22:32
JoeGaudet1 & 322:32
JoeGaudetI'd like it to run as not root22:32
JoeGaudetand stop + start by a non root user22:32
JanCon Ubuntu or on another OS using upstart?22:34
JanCupstart supports user jobs, but not on Ubuntu (yet?) AFAIK22:36
JanCrun as non-root is easy with 'su'22:37
JanCstart/stop as non-root might require changes to /etc/sudoers22:38
JoeGaudetUbuntu22:38
JanCdepending on if the user is already able to use sudo...22:39
JanCJoeGaudet: by default on Ubuntu all users who are members of the groups "admin" or "sudo" can become root using sudo22:41
JanCso depends on if you want non-privileged users to start/stop your service too...22:42
JoeGaudetI do yeah22:43
JoeGaudetI have script that builds the jar that needs to be run22:43
JanCJoeGaudet: does it have to run as the user who starts your service?22:43
JoeGaudetSo at the end of the script I'd just like to have stop <serviceName>; start <serviceName>22:44
JoeGaudetNope22:44
JoeGaudetI could be someone else22:44
JoeGaudetthough Ideally i'd like it to be owned by deploy22:44
JoeGaudetfor organization sake22:44
SpamapSJanC: don't use 'su' for running as not root btw22:44
SpamapSJanC: it keeps the 'pam' session open for the user, causes problems22:44
JanCSpamapS: ah, what's the recommended way then?22:45
SpamapSJanC: start-stop-daemon is safer22:45
JanCah, right22:45
SpamapSJanC: or on precise and later, setuid/setgid .. though the problem with that is pre-start and post-start run as not-root too, which can be problematic22:46
JanCsounds like we need something more fine-grained in a future upstart then  ;)22:47
JoeGaudetindeed22:51
JoeGaudetI'll give it a poke later 22:52
SpamapSJanC: yeah its been discussed that the setuid/setgid should be arguments to script/exec .. that would work.23:15
SpamapSJanC: so you'd have 'script setuid nobody\n...end script'23:15
benburkerti've got an upstart job that is failing to start, but "start job" says the job is already running23:26
benburkertis there any way to debug upstart to check what process it considers this job to be?23:26
SpamapSbenburkert: status jobname23:39
benburkertSpamapS: status says it's up, but it's not, is there any way to get the PID that it thinks the job is?23:45
SpamapS"up" ?23:47
SpamapSbenburkert: a job does not need a pid to be in a start/running state.23:47
SpamapSbenburkert: if a job has no exec/script section, it will not track a pid23:48
benburkertit's the default mysql package23:48
benburkertwhich has exec /usr/sbin/mysqld23:48
SpamapSbenburkert: and status shows 'start/running' but no pid?23:48
benburkertbut it also has a pre-start and a post-start script23:49
benburkertSpamapS:  yes23:49
SpamapSbenburkert: that would be a bug then. As soon as that process goes away, the job should go into respawn mode, or stop/waiting23:49
SpamapSbenburkert: do you maybe have an override file?23:50
benburkertwhere would that be?23:50
benburkertalso, is there any other logs than syslog for this stuff?23:50
SpamapS/etc/init/mysql.override23:56
SpamapSbenburkert: you can up the verbosity with 'initctl log-priority info'23:56
SpamapSbenburkert: all logs should be in /var/log/syslog23:57
benburkertSpamapS: there's a /etc/init/mysql.conf.dpkg-dist file, would that be it?23:58
SpamapSbenburkert: no, but that is the original file, diff against that to see what local mods have been made23:59

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!