• A systemd unit for magick

    From Al@21:4/106.1 to apam on Fri Oct 18 16:16:14 2019
    Hello Apam,

    Last night I followed the debian wiki and wrote a quick systemd unit for magicka and last night I set it up and started magicka with it. Can you
    think of any reason I shouldn't do that?

    So far everthing seems to be running well. I have logged in and out
    several times and haven't had any issues.

    That is a brand new and untested unit so it may need to be worked on
    further yet.

    I found a unit for binkd so I installed that and it's working well so the magicka.service is based on that. Only had those online for 12 hours or
    so at this point but it's looking good.

    Looking at the commands in there, one of them uses a sighup to reload the service if it ever comes to that. Does Magicka recognize a sighup signal
    to reload?

    I haven't used the reload option but systemctl start/stop/status magicka.service all seem to work as expected.

    Ttyl :-)
    Al

    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)
  • From apam@21:1/126 to Al on Sat Oct 19 10:08:50 2019
    Last night I followed the debian wiki and wrote a quick systemd unit
    for magicka and last night I set it up and started magicka with it.
    Can you think of any reason I shouldn't do that?

    Should be fine.

    Looking at the commands in there, one of them uses a sighup to reload
    the service if it ever comes to that. Does Magicka recognize a sighup signal to reload?

    No, you'll have to start and stop magicka to reload config files. I
    suspect sending sighup to magicka will cause it to quit (not sure what
    the default action of sighup is). and SystemD should restart it, so
    perhaps it will work? Not sure.

    Andrew

    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: HappyLand (21:1/126)
  • From Al@21:4/106.1 to apam on Fri Oct 18 17:37:08 2019
    No, you'll have to start and stop magicka to reload config files. I suspect sending sighup to magicka will cause it to quit (not sure what
    the default action of sighup is). and SystemD should restart it, so perhaps it will work? Not sure.

    The default action for sighup is to reload the config.

    I did issue systemctl reload magicka just to see what would happen and it issued an error, I forget now what it was but it was minor. It must have stopped and restarted magicka anyway since I had made changes to my
    message area config and after that I could see them on the BBS.

    So it seems good to me. It'll start magicka if it reboots for some reason
    and I am not there to start it systemd will start it and also restart
    magicka if a reload is issued for some reason.

    I'm going to do the same for magichat but it's still running happily in
    gdb so I'll leave it alone for now.

    Ttyl :-)
    Al

    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)
  • From apam@21:1/126 to Al on Sat Oct 19 12:16:52 2019
    The default action for sighup is to reload the config.

    No, SIGHUP will only reload config if you write your program in such a
    way to intercept the signal and act accordingly, which is probably usual
    for most unix daemons. However when programming with signals, if you
    don't write a signal handler and install it it has a default (SIGKILL you
    can't though, but others you can). Ah I just googled it, the default
    action is an abnormal termination - ie quit the program.

    I'm not sure what you can do with systemd, but for restart, the ideal
    would be SIGKILL and restart (for magicka that is).

    I'm going to do the same for magichat but it's still running happily in gdb so I'll leave it alone for now.

    Sounds good. I'm glad we got that one sorted, I would never have caught
    it by myself as I don't have IPv6.

    Andrew


    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: HappyLand (21:1/126)
  • From apam@21:1/126 to Al on Sat Oct 19 14:55:42 2019
    Al,

    I just logged into your BBS, I think there might be something wrong with
    your systemd script.

    It appears to be starting / restarting magicka everytime someone
    connects.

    Andrew


    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: HappyLand (21:1/126)
  • From Al@21:4/106.1 to apam on Fri Oct 18 22:30:20 2019
    I just logged into your BBS, I think there might be something wrong with your systemd script.

    It appears to be starting / restarting magicka everytime someone
    connects.

    Yep, systemctl status magicka confirms that, so I've disabled it for now.

    Ttyl :-)
    Al

    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)
  • From Al@21:4/106.1 to apam on Fri Oct 18 22:34:00 2019
    I'm not sure what you can do with systemd, but for restart, the ideal would be SIGKILL and restart (for magicka that is).

    I'll have to take a walk through some docs and perhaps look over some
    unit files and see what makes them tick.

    My current magicka.service was set to restart on-failure. Not sure where
    it got the idea there was a failure but I'll see if I can figure
    something better out.

    Ttyl :-)
    Al

    --- MagickaBBS v0.13alpha (Linux/x86_64)
    * Origin: The Rusty MailBox - Penticton, BC Canada (21:4/106.1)