=== stereoit is now known as stereoit_ | ||
=== stereoit is now known as stereoit_ | ||
Qantourisc | Upstart doesn't shutdown when SIGTERM is end to /sbin/init | 16:02 |
---|---|---|
Qantourisc | instead it says | 16:02 |
Qantourisc | write(12, "<4>init: Re-executing /sbin/init"..., 33) = 33 | 16:03 |
switchflip | Has anyone on here tried getting a phoenix app to run using upstart? | 19:41 |
JanC | Qantourisc: isn't that what is supposed to happen? | 19:45 |
Qantourisc | JanC: not accordig to man page 8 init | 19:45 |
JanC | oh, you mean a user upstart? | 19:48 |
JanC | I mean a session upstart | 19:48 |
Qantourisc | JanC: wait "user upstart" | 19:50 |
Qantourisc | why would it start as user-upstart (well i can think of a few reason) | 19:50 |
Qantourisc | but what would be required for it to start as such ? | 19:50 |
Qantourisc | /sbin/init is started | 19:50 |
* Qantourisc looks for some flags to force session upstart | 19:53 | |
JanC | Qantourisc: if you are using upstart as system init then SIGTERM should restart it | 19:54 |
Qantourisc | (running in lxc btw) | 19:54 |
Qantourisc | JanC: so i want non-session :D | 19:54 |
JanC | right | 19:54 |
Qantourisc | but won't that disable tomany init functions ? | 19:54 |
Qantourisc | then again i need verry litle | 19:54 |
JanC | and the manpage doesn't say anything but no-session | 19:54 |
JanC | about non-session | 19:55 |
Qantourisc | networking, maybe some /dev/ nodes, and then services i want | 19:55 |
JanC | right | 19:55 |
Qantourisc | "--user Starts in user mode, as used for user sessions. Upstart will be run as an unprivileged user," | 19:55 |
Qantourisc | JanC: can i still run it as root ? :p | 19:56 |
JanC | Qantourisc: if you want to shut down the system, just use the usual tools for that? | 19:56 |
JanC | shutdown/halt/reboot ? | 19:57 |
Qantourisc | JanC: not an option | 19:57 |
Qantourisc | lxc send stuff to /dev/initctl | 19:57 |
Qantourisc | (missing) | 19:57 |
Qantourisc | and alternatly SIGTERM to /bin/init | 19:57 |
Qantourisc | well no console, that doesn't boad well | 19:58 |
Qantourisc | well alteast shutdown worked this time :D | 19:58 |
Qantourisc | but no more init ! | 19:59 |
Qantourisc | --user works with shutdown but start no services (that i can see) | 20:00 |
Qantourisc | leave it out, no shutdown | 20:00 |
JanC | --user is for user sessions | 20:01 |
Qantourisc | JanC: well I have no clue how to shutdown upstart then | 20:02 |
JanC | and that's what the SIGTERM in the manpage refers to | 20:02 |
Qantourisc | other then a big red-sticker | 20:02 |
Qantourisc | FIRST SHUTDOWN LXC SERVER before shuting down LXC host | 20:02 |
Qantourisc | O wait | 20:03 |
Qantourisc | there is 1 alternati e | 20:03 |
Qantourisc | write a small deamon that replaces /dev/initctl | 20:03 |
Qantourisc | and pass the requests to init | 20:03 |
JanC | why not just use initctl? | 20:04 |
Qantourisc | JanC: the app ? | 20:04 |
Qantourisc | Or the named-pipe ? | 20:05 |
JanC | shutdown, initctl, etc. (they come with upstart for a reason) | 20:05 |
Qantourisc | JanC: i'm not running the shutdown | 20:05 |
Qantourisc | LXC is | 20:05 |
Qantourisc | first it tries /dev/initctl | 20:06 |
Qantourisc | then it tries sigterm to /sbin/init | 20:06 |
Qantourisc | JanC: you happen to know the interface of /dev/initctl ? :D | 20:07 |
Qantourisc | mwea nevermid I can just sniff it, i need to write the api anyway | 20:07 |
Qantourisc | hmm this shouldn't be more then 8 lines of python to think of it :D | 20:09 |
Qantourisc | it sends 'b'i\x19\t' | 20:14 |
Qantourisc | the api is ... weird | 20:24 |
Qantourisc | every second it receives a b'' and otherwise it gets a b'\x00' | 20:26 |
Qantourisc | first shutdown comand send i \x19 \t \x03 \x01 | 20:26 |
Qantourisc | ooow 0x00 mean: connection closed | 20:36 |
Qantourisc | JanC: 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 |
Qantourisc | indicating the desired new-run-level | 21:29 |
* Qantourisc now needs to turn this thing into a deamon | 21:30 | |
Qantourisc | ok works like a bloody charm | 21:35 |
JanC | upstart's init doesn't know what runlevels are... | 21:50 |
Qantourisc | JanC: doesn't matter, one just translate the sysintv to the desired action for upstart, as said, works like a charm | 22:31 |
Qantourisc | Will have to look into permissions, i tihnk anyone can shutdown the machine now :p | 22:31 |
Qantourisc | nope just root, perfect | 22:32 |
* Qantourisc goes to bed | 22:32 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!