/srv/irclogs.ubuntu.com/2015/08/11/#upstart.txt

=== stereoit is now known as stereoit_
=== stereoit is now known as stereoit_
QantouriscUpstart doesn't shutdown when SIGTERM is end to /sbin/init16:02
Qantouriscinstead it says16:02
Qantouriscwrite(12, "<4>init: Re-executing /sbin/init"..., 33) = 3316:03
switchflipHas anyone on here tried getting a phoenix app to run using upstart?19:41
JanCQantourisc: isn't that what is supposed to happen?19:45
QantouriscJanC: not accordig to man page 8 init19:45
JanCoh, you mean a user upstart? 19:48
JanCI mean a session upstart19:48
QantouriscJanC: wait "user upstart"19:50
Qantouriscwhy would it start as user-upstart (well i can think of a few reason)19:50
Qantouriscbut what would be required for it to start as such ?19:50
Qantourisc/sbin/init is started19:50
* Qantourisc looks for some flags to force session upstart19:53
JanCQantourisc: if you are using upstart as system init then SIGTERM should restart it19:54
Qantourisc(running in lxc btw) 19:54
QantouriscJanC: so i want non-session :D19:54
JanCright19:54
Qantouriscbut won't that disable tomany init functions ?19:54
Qantouriscthen again i need verry litle19:54
JanCand the manpage doesn't say anything but no-session19:54
JanCabout non-session19:55
Qantouriscnetworking, maybe some /dev/  nodes, and then services i want19:55
JanCright19:55
Qantourisc"--user Starts in user mode, as used for user sessions. Upstart will be run as  an  unprivileged  user,"19:55
QantouriscJanC: can i still run it as root ? :p19:56
JanCQantourisc: if you want to shut down the system, just use the usual tools for that?19:56
JanCshutdown/halt/reboot ?19:57
QantouriscJanC: not an option19:57
Qantourisclxc send stuff to /dev/initctl19:57
Qantourisc(missing)19:57
Qantouriscand alternatly SIGTERM to /bin/init19:57
Qantouriscwell no console, that doesn't boad well19:58
Qantouriscwell alteast shutdown worked this time :D19:58
Qantouriscbut no more init !19:59
Qantourisc--user works with shutdown but start no services (that i can see)20:00
Qantouriscleave it out, no shutdown20:00
JanC--user is for user sessions20:01
QantouriscJanC: well I have no clue how to shutdown upstart then20:02
JanCand that's what the SIGTERM in the manpage refers to20:02
Qantouriscother then a big red-sticker20:02
QantouriscFIRST SHUTDOWN LXC SERVER before shuting down LXC host20:02
QantouriscO wait20:03
Qantouriscthere is 1 alternati e20:03
Qantouriscwrite a small deamon that replaces /dev/initctl20:03
Qantouriscand pass the requests to init20:03
JanCwhy not just use initctl?20:04
QantouriscJanC: the app ?20:04
QantouriscOr the named-pipe ?20:05
JanCshutdown, initctl, etc. (they come with upstart for a reason)20:05
QantouriscJanC: i'm not running the shutdown20:05
QantouriscLXC is20:05
Qantouriscfirst it tries /dev/initctl20:06
Qantouriscthen it tries sigterm to /sbin/init20:06
QantouriscJanC: you happen to know the interface of /dev/initctl ? :D20:07
Qantouriscmwea nevermid I can just sniff it, i need to write the api anyway20:07
Qantourischmm this shouldn't be more then 8 lines of python to think of it :D20:09
Qantouriscit sends 'b'i\x19\t'20:14
Qantouriscthe api is ... weird20:24
Qantouriscevery second it receives a b'' and otherwise it gets a b'\x00'20:26
Qantouriscfirst shutdown comand send i \x19 \t \x03 \x0120:26
Qantouriscooow 0x00 mean: connection closed20:36
QantouriscJanC: ok got the script ready, took some diffing, uses some weird format, 4 integers, of wich the 3one is actually just int( char() )21:29
Qantouriscindicating the desired new-run-level21:29
* Qantourisc now needs to turn this thing into a deamon21:30
Qantouriscok works like a bloody charm21:35
JanCupstart's init doesn't know what runlevels are...21:50
QantouriscJanC: doesn't matter, one just translate the sysintv to the desired action for upstart, as said, works like a charm22:31
QantouriscWill have to look into permissions, i tihnk anyone can shutdown the machine now :p22:31
Qantouriscnope just root, perfect22:32
* Qantourisc goes to bed22:32

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