/srv/irclogs.ubuntu.com/2011/05/04/#upstart.txt

karshanhey00:06
karshani'm looking for a way to get an upstart script running on shutdown, the only way I can seem to do it is with a "start on runlevel 0"00:06
karshanis there no analog event to startup in upstart ?00:06
JanCkarshan: I thin kthat currently there is none00:09
karshanoh ok.. thanks. you know about any plans of removing the sysv legacy stuff like runlevels or is upstart gonna keep them00:09
JanCkarshan: technically, the runlevel stuff isn't part of upstart00:10
karshanwell i mean the runlevel events and the stuff in util/sysv.c etc.00:10
JanCsome people (especially in the embedded space) don't use any of that00:11
karshanyeah I guess. I was just confused since all /sbin/shutdown does is set the runlevel to 0 and let out an event, it expects some sctript to run /sbin/halt on runlevel 0.00:12
JanC'shutdown' is part of the sysv compatibility tools IIRC  ;)00:12
karshanahh. yes ofcourse00:14
karshanI still think there should be a shutdown event (not runlevel 0) though, so when something like reboot is executed all jobs are stopped etc.00:15
JanCkarshan: in general, upstart will just stop all jobs if you do that00:16
karshanJanC: well what about tasks that need to be carried out like unmounting the filesystems00:16
JanCkarshan: you can use whatever event you want for that?00:19
JanCthe thing with upstart is that it's very generic00:21
karshanbut how do i get the event generated at shutdown00:21
JanCwhich is an advantage and a disadvantage00:21
karshani.e. without putting an "inttctl emit shutdown" in the stop script of some random job00:22
JanCkarshan: that's exactly what you want to do  ;)00:23
JanCactually, put it into the utility/script that starts shutdown00:23
karshanyeah that makes more sense00:24
karshanthats what I was saying though00:24
JanCand whatever name you give it is your choice00:24
karshanshutdown, or since thats sysv legacy, reboot should have something like that00:24
karshani mean in reboot.c, there should be some code to emit a shutdown event, since it seems pretty useful, most systems would have scripts running on shutdown no ?00:26
JanCit might be useful to add an example reboot which does that00:27
karshanyeah00:27
JanCfor those who want to set up a system without syv compatibility00:28
JanCsysv00:28
JanC(I'm not sure if one exists)00:28
karshanmm hmm.. you think its worth posting the code to the mailing list, see if it gets included maybe00:29
JanCKeybuk: ^^^00:29
JanCkarshan: in any case, aking on the ML doesn't hurt  ;)00:29
JanCasking00:29
JanCcurrently most people seem to thing upstart is only upstart + sysv-compatibility as used in Ubuntu00:31
karshanyeah, so i've seen, it took me a while to find any scripts that had nothing to do with sysv compatibility00:31
JanCI expect Google's Chrome OS uses it differently00:32
JanCand the embedded users, but those might not always be public00:32
JanCor more difficult to find00:32
karshanyeah.. i'm building an lfs system, and i didnt want any sysv init stuff, so hopefully i'll have a nice set of upstart scripts legacy free by the end of it00:34
JanCkarshan: in that case you can offer them to the project00:34
karshanyup :)00:34
JanCeven if only to put them into an "examples" or "contrib" directory00:34
Keybukhey was at the gym00:59
JanCKeybuk: karshan thinks it would be nice to include examples for a non-sysv-compatible system01:01
KeybukJanC, karshan: right, the reason there's no non-SyS V shutdown event is because the people using Upstart without the SysV stuff are largely in the embedded space01:01
Keybukand for them "poweroff -f" is pretty close01:01
Keybukso it's not been a feature request someone's wanted enough to provide a patch01:02
dcorbin_wkHow should (can I?) configure certain upstart services to be controllable by non-root users?12:12
JanCdcorbin_wk: configure sudo to allow them to execute the necessary commands?15:39
dcorbin_wkJanC: the commands are "start" and "stop", right?  can you make sudo only allow certain arguments?16:01
JanCyes, see sudoers(5)16:01
JanCthere are all sorts of examples in it16:03
dcorbin_wkOK.  Thanks.16:16
marruslAnyone know...  can you change the shell that upstart uses for scripts without changing the /bin/sh -> dash link?18:24
SpamapSmarrusl: init/paths.h:#define SHELL "/bin/sh"18:50
SpamapSmarrusl: tho Keybuk might know another way. ;)18:50
marruslSpamapS, well THAT I'm not going to support.  :-)18:50
Keybukhmm?18:52
SpamapSKeybuk: " < marrusl> Anyone know...  can you change the shell that upstart uses for scripts without changing the 18:54
SpamapS                 /bin/sh -> dash link?"18:54
Keybukright18:54
Keybukor18:54
Keybuk./configure CPPFLAGS=-DSHELL=/bin/crush18:54
marruslheh.  well thanks SpamapS, Keybuk.  good to know,  it's a weird request.  I don't think they'll care enough to want to roll their own.  :)18:56
Keybukit's the kind of change that's best done at compile time18:59
marruslKeybuk, and they are free to change the link if they'd really like to.  Not that i'm suggesting they do.19:01
Keybukyeah, exactly19:06
Keybukand really, Why?19:06
marruslKeybuk, I'm curious, I didn't hear why yet.  I know they were working on a network startup issue (LP bug: 777193).  they probably added some debug statements that had a bashism in them.  probably wasn't anything more than that.19:40
radixI'm trying to get ubuntu working in a vserver... I've got it configured to some extent, where upstart is services properly when it comes up, but after that any start/restart/stop commands I run just block while polling on the connection to init20:28
radixis there something I should try to help figure out what's going wrong?20:28
JanCradix: there are some instructions about upstart + vserver on the vserver wiki IIRC21:52
radixJanC: yeah, and I followed them21:52
radixI'm not convinced that whoever wrote them got it fully working, or maybe just some software has changed since then21:52
radixthey got me to the point that services were starting at boot, but I've always had this blocking problem21:52
JanCI have seen people in here who got it working with those instructions21:52
* JanC has no experience with it though21:53
Keybukif those commands block, you haven't got upstart working in a vserver21:53
Keybukand are probably using some other daemon21:53
reiddraperif I have a process that I manage with upstart, and it forks on `reload`, will upstart keep track of it?21:53
Keybukreiddraper: no21:53
radixit's definitely upstart, I've straced both init and the commands21:53
radixand seen them connecting on @/com/ubuntu/upstart21:53
reiddraperKeybuk: is there a workaround?21:53
radixcould a misbehaving service specification possibly make one of those commands block? 21:54
JanCradix: in some cases21:56
radix'strace -f restart cron': http://pastebin.ubuntu.com/603486/        'strace -f -p 1': http://pastebin.ubuntu.com/603487/23:52
radixcould this perhaps offer some clue about my problem?23:52
radixit looks like the processes are at the very least communicating23:54
radixand netstat does tell me that process 1 is listening on @/com/ubuntu/upstart, so I assume that means it is actually upstart :)23:55

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