/srv/irclogs.ubuntu.com/2012/02/09/#upstart.txt

bradleyayersI'd like to do complex "start on" conditions and restarting is important to me, I think I saw someone say the issue could be worked around by using extra jobs, but I don't remember the specifics, can anyone point me in the right direction?06:30
benceri've made the followin dansguardian upstart job but echo doesnt work despite using console output http://paste.ubuntu.com/834957/ could anyone  give me some hints?08:57
bencerJanC: you suggested a couple of days ago that this was the right channel to ask feedback on upstart scripts?  if you have the time, have a look at my previous message14:29
=== marrusl_ is now known as marrusl
marruslwhat are the most likely reasons to see runlevel "unknown" ?20:16
marruslSpamapS, ^ :)20:16
marruslfrom what I gather it's often a sys v service failing?20:16
SpamapSmarrusl: if you're up to sysv.. you're at runlevel 2 already20:20
marrusldoh20:21
marruslSpamapS, sooooo.... no.20:21
marruslWhat else?20:21
marruslI'm going to get a --verbose log regardless.20:22
marruslBut it hasn't happened since we started looking!  (of course)20:22
bradleyayersbencer: i assume you're using upstart 1.4?20:51
bencerbradleyayers: i'm using precise21:13
bencerso, yes, 1.421:13
bencereverything works fine, but the output thing21:13
bradleyayersdoes it work if you log to a file?21:15
SpamapSmarrusl: unknown is schroedingers runlevel21:48
marruslSpamapS, lol.  yea verily.21:50
bencerbradleyayers: as far as i could see no, should go to syslog, right?21:57
benceror you mean echoing into a /tmp file?21:57
bradleyayerswell there's console options to output to a file aren't there? i meant try those21:58
bencerok, going to give that a try21:58
bradleyayersperhaps pre-start stuff doesn't adhere to the same console rules as exec/script21:58
bencerby default should be logging to syslog, right?22:01
SpamapSI'm not 100% certain but IIRC console log is still disabled in precise22:16
SpamapSyou have to boot with '--log'22:16
bencerSpamapS: so, now way to echo anything into the console?22:20
bencerbasically i'm trying to replicate init.d behaviour as close as possible: http://paste.ubuntu.com/834957/22:20
SpamapSbencer: console output will go to /dev/console22:21
SpamapSbencer: and | logger  will go to syslog22:21
bencerand what about echoing to the terminal?22:22
SpamapSthats not possible22:22
bencerok, understood22:22
SpamapSits been discussed.. perhaps via a dbus channel to initctl22:22
SpamapSbut first we wanted to be able to log somewhere reliably :)22:22
bencerwhat do you suggest i should do in this case?22:22
bencer/dev/console or syslog?22:23
bencerbecause i'm going to find this issue in other init.d scripts22:23
SpamapSbencer: for precise?22:23
benceryes22:23
SpamapSbencer: --log will be on by default22:23
SpamapSso use console log22:23
bencerSpamapS: what i'm trying to do is to submit patches to migrate dansguardian, isc-dhcp, bind9 and slapd (at least) to upstart22:24
SpamapSbencer: slapd you have to be careful with.. 22:24
bencerand i've 7 days left :)22:24
SpamapSbencer: its signals are non-standard22:24
SpamapSbencer: it may be better to still call the init.d script, from pre-start and post-stop scripts.. and just the upstart job to control when it starts/stops in the boot22:25
bencerwhat should i do in this case?22:25
ianl`is it possible to start a process as another user, instead of as root using upstart?22:25
benceractually i'm very interested in the respawn thing22:25
bencernot in the boot speed up22:25
SpamapSianl`: http://upstart.ubuntu.com/cookbook/#changing-user22:26
ianl`thanks22:26
SpamapSbencer: s/boot speed up/boot coordination/22:26
benceragreed, speed up is only a consecuence of that :)22:26
SpamapSbencer: having an upstart job has very little to do with speed up.. it allows you to coordinate the start of other things which need slapd22:26
bencerand is there any way to transform signals or something like that? or i'm basically against the wall here?22:27
SpamapSbencer: you can change the kill signal, but not the reload signal22:29
bencerSpamapS: so the problem is that slapd doesnt use sighup for reloading?22:31
SpamapSbencer: right, and I think TERM is also dangerous22:31
SpamapSbencer: RTFM on slapd before doing this. :)22:31
benceri will22:31
bencerthanks for the feedback22:31
bencerwell, i could imagine if nobody had done this before for popular packages like slapd, there was a reason22:32
SpamapSbencer: there are open bugs on many22:34
bencerwell, for example on dansguardian seems to be trivial to do22:35
SpamapSbencer: frankly, I don't see enough value for some things. slapd actually does need to be done, because it can be used to support local auth22:35
benceron my experience, for example, dansguardian is very useful, on zentyal dansguardian used to die from time to time, using the respawn thing, if it crashes, everybody is happy because it comes back to life itself22:36
bencerand this way, we dont have to install other things like runit or similar22:37
SpamapSI love the concept. But upstart's development hasn't really blossomed enough to support all the use cases that init.d scripts can.22:39
bencerwhat we used to do in zentyal to take advantage of the respawn thing was22:42
bencerpre-start script22:43
bencer    /etc/init.d/slapd stop || true22:43
bencerend script22:43
bencerexec /usr/sbin/slapd -d 0 -h 'ldap://0.0.0.0/ ldapi://%2fvar%2frun%2fslapd%2fldapi/????x-mod=0777' -u openldap -g openldap -F /etc/ldap/slapd.d/22:43
bencerrespawn22:43
bencerbut then, if we slapd gets updated, the postinst does invoke-rc.d slapd restart22:43
bencerand things can go funny22:43
SpamapSbencer: in newer versions of invoke-rc.d, restart is stop/start22:49
SpamapSbencer: it used to not reload the upstart file22:49

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