Totum | hi.. 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 |
---|---|---|
Totum | all of the guides seem to assume this knowledge, and I cannot find anything but a handful of examples from scripts that other people have written | 16:11 |
SpamapS | Totum: 'man upstart-events' | 16:13 |
SpamapS | Totum: *most* regular services should just 'start on runlevel [2345]' and 'stop on runlevel [^2345]' | 16:13 |
Totum | hi 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 |
marrusl | Hmmm... what might cause mountall not to emit "filesystem"? | 19:15 |
marrusl | I have a situation where that's happening and so rc-sysinit doesn't run. | 19:18 |
marrusl | and syslog has "init: Handling filesystem/failed event" | 19:19 |
marrusl | but then when you telinit 2, the sys v runs and everything seems normal. | 19:19 |
marrusl | I'm going to have to wait for a reproducer. all i have is " grep "init:" /var/log/syslog..... | 19:21 |
marrusl | so maybe there's some obvious reason as to why "filesystem" isn't getting emitted in the full logs. | 19:24 |
marrusl | SpamapS, ^^ do you know the criteria for mountall to emit "filesystem"? | 19:25 |
marrusl | I guess this is really more of a mountall question... omg... I just looked at man mountall | 19:25 |
marrusl | still says "temporary". | 19:26 |
marrusl | ;-) | 19:26 |
JoeGaudet | Hey gues | 20:04 |
JoeGaudet | guys | 20:04 |
JoeGaudet | I am new to upstart, just wondering how I can make an upstart process not belong to root. | 20:04 |
JoeGaudet | That is to say, I can start / stop it with another specified user. | 20:04 |
SpamapS | marrusl: filesystem is emtited when all filesystems are mounted from /etc/fstab | 20:37 |
SpamapS | marrusl: excluding 'nowait' | 20:38 |
SpamapS | marrusl: that includes any remote filesystems.. which are only known to be remote because mountall has a big switch/case | 20:38 |
SpamapS | JoeGaudet: you can actually | 20:54 |
SpamapS | JoeGaudet: there's a dbus socket that non-root users can use to call initctl (which start/stop are just aliases for) | 20:54 |
SpamapS | JoeGaudet: the permissions are specified on Ubuntu in /etc/dbus-1/system.d/Upstart.conf | 20:57 |
marrusl | SpamapS, ok. That's about what I expected. Thanks for the info. | 20:58 |
JoeGaudet | SpamapS: So I can basically add a policy for another user in that conf file ? | 21:21 |
JoeGaudet | hrm | 21:21 |
SpamapS | JoeGaudet: or just add that user to the admin group | 21:25 |
SpamapS | JoeGaudet: oh actually there's nothing special for admin. So yeah, you'd just make another user like 'root' | 21:26 |
SpamapS | JoeGaudet: almost easier to just use sudo..... | 21:26 |
JoeGaudet | This is part of a one click deploy script though | 21:33 |
JoeGaudet | that isn't run as root | 21:33 |
SpamapS | JoeGaudet: 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 |
JanC | JoeGaudet: 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 |
JoeGaudet | 1 & 3 | 22:32 |
JoeGaudet | I'd like it to run as not root | 22:32 |
JoeGaudet | and stop + start by a non root user | 22:32 |
JanC | on Ubuntu or on another OS using upstart? | 22:34 |
JanC | upstart supports user jobs, but not on Ubuntu (yet?) AFAIK | 22:36 |
JanC | run as non-root is easy with 'su' | 22:37 |
JanC | start/stop as non-root might require changes to /etc/sudoers | 22:38 |
JoeGaudet | Ubuntu | 22:38 |
JanC | depending on if the user is already able to use sudo... | 22:39 |
JanC | JoeGaudet: by default on Ubuntu all users who are members of the groups "admin" or "sudo" can become root using sudo | 22:41 |
JanC | so depends on if you want non-privileged users to start/stop your service too... | 22:42 |
JoeGaudet | I do yeah | 22:43 |
JoeGaudet | I have script that builds the jar that needs to be run | 22:43 |
JanC | JoeGaudet: does it have to run as the user who starts your service? | 22:43 |
JoeGaudet | So at the end of the script I'd just like to have stop <serviceName>; start <serviceName> | 22:44 |
JoeGaudet | Nope | 22:44 |
JoeGaudet | I could be someone else | 22:44 |
JoeGaudet | though Ideally i'd like it to be owned by deploy | 22:44 |
JoeGaudet | for organization sake | 22:44 |
SpamapS | JanC: don't use 'su' for running as not root btw | 22:44 |
SpamapS | JanC: it keeps the 'pam' session open for the user, causes problems | 22:44 |
JanC | SpamapS: ah, what's the recommended way then? | 22:45 |
SpamapS | JanC: start-stop-daemon is safer | 22:45 |
JanC | ah, right | 22:45 |
SpamapS | JanC: 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 problematic | 22:46 |
JanC | sounds like we need something more fine-grained in a future upstart then ;) | 22:47 |
JoeGaudet | indeed | 22:51 |
JoeGaudet | I'll give it a poke later | 22:52 |
SpamapS | JanC: yeah its been discussed that the setuid/setgid should be arguments to script/exec .. that would work. | 23:15 |
SpamapS | JanC: so you'd have 'script setuid nobody\n...end script' | 23:15 |
benburkert | i've got an upstart job that is failing to start, but "start job" says the job is already running | 23:26 |
benburkert | is there any way to debug upstart to check what process it considers this job to be? | 23:26 |
SpamapS | benburkert: status jobname | 23:39 |
benburkert | SpamapS: 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 |
SpamapS | benburkert: a job does not need a pid to be in a start/running state. | 23:47 |
SpamapS | benburkert: if a job has no exec/script section, it will not track a pid | 23:48 |
benburkert | it's the default mysql package | 23:48 |
benburkert | which has exec /usr/sbin/mysqld | 23:48 |
SpamapS | benburkert: and status shows 'start/running' but no pid? | 23:48 |
benburkert | but it also has a pre-start and a post-start script | 23:49 |
benburkert | SpamapS: yes | 23:49 |
SpamapS | benburkert: that would be a bug then. As soon as that process goes away, the job should go into respawn mode, or stop/waiting | 23:49 |
SpamapS | benburkert: do you maybe have an override file? | 23:50 |
benburkert | where would that be? | 23:50 |
benburkert | also, is there any other logs than syslog for this stuff? | 23:50 |
SpamapS | /etc/init/mysql.override | 23:56 |
SpamapS | benburkert: you can up the verbosity with 'initctl log-priority info' | 23:56 |
SpamapS | benburkert: all logs should be in /var/log/syslog | 23:57 |
benburkert | SpamapS: there's a /etc/init/mysql.conf.dpkg-dist file, would that be it? | 23:58 |
SpamapS | benburkert: no, but that is the original file, diff against that to see what local mods have been made | 23:59 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!