• Mystic Relay Chat Daemon (RPI/Linux)

    From Grud@21:1/171 to All on Sunday, September 18, 2016 18:45:00
    Is there a neat way to daemonize the mrc_client.py and mrc_server.py for
    Mystic Relay Chat on startup?

    I have tried nohup python mrc_client.py in the rc.d but it seems to not work when run as a root.

    Thanks

    --- Mystic BBS v1.11 (Raspberry Pi)
    * Origin: : : ::] phaseshift BBS [:: : : (21:1/171)
  • From Pequito@21:1/126 to Grud on Monday, September 19, 2016 04:05:00
    On 09/18/16, Grud said the following...

    Is there a neat way to daemonize the mrc_client.py and mrc_server.py for Mystic Relay Chat on startup?

    I have tried nohup python mrc_client.py in the rc.d but it seems to not work when run as a root.

    Just add & at the end of the command and it should put it in the background.
    :)

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: Twinkle BBS (21:1/126)
  • From Indrid Cold@21:1/165 to Grud on Monday, September 19, 2016 15:50:00
    Is there a neat way to daemonize the mrc_client.py and mrc_server.py for Mystic Relay Chat on startup?

    Welcome Grud!

    I'm hosting by BBS on raspberry too, precisely mod. 1 B. I've setup a script that is checking by CRONTAB each 5 min. if MRC is running, if yes=NONE, if no=EXEC and if double process=KILL the youngest.

    So, there's no need to insert it cheap&dirt in /etc/rc.local - or other:
    5min, and it starts.

    ¯¯ÅndçŒd Cíld®®

    "What do you look like?"
    "It depends on who is looking."

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: Miskatonic BBS | telnet://rasppi.servebbs.org (21:1/165)
  • From Indrid Cold@21:1/165 to Indrid Cold on Monday, September 19, 2016 15:55:00
    So, there's no need to insert it cheap&dirt in /etc/rc.local - or other: 5min, and it starts.

    As Pequito said, just remember '&' at the end of the exec string! It will put the process in bg - sorry, I was forgiving to tell this :)

    ¯¯ÅndçŒd Cíld®®

    "What do you look like?"
    "It depends on who is looking."

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: Miskatonic BBS | telnet://rasppi.servebbs.org (21:1/165)
  • From Solarbaby@21:1/151 to Grud on Monday, September 19, 2016 07:19:00
    Is there a neat way to daemonize the mrc_client.py and mrc_server.py for

    nohup python mrc_client.py tbbs.homeip.net 500 &

    --- Mystic BBS v1.12 A29 (Raspberry Pi)
    * Origin: Solar BBS (21:1/151)
  • From Pequito@21:1/126 to Solarbaby on Monday, September 19, 2016 10:54:00
    On 09/19/16, Solarbaby said the following...

    Is there a neat way to daemonize the mrc_client.py and mrc_server.py

    nohup python mrc_client.py tbbs.homeip.net 500 &

    Make sure that says 5000 not 500. :P

    --- Mystic BBS v1.12 A31 (Linux)
    * Origin: Twinkle BBS (21:1/126)
  • From Grud@21:1/171 to Indrid Cold on Wednesday, September 21, 2016 08:05:00
    Any chance you could share that script? I know cron can run scripts at different users, which seems to be my problem.

    --- Mystic BBS v1.11 (Raspberry Pi)
    * Origin: : : ::] phaseshift BBS [:: : : (21:1/171)
  • From Indrid Cold@21:1/165 to Grud on Wednesday, September 21, 2016 18:50:00
    Any chance you could share that script? I know cron can run scripts at different users, which seems to be my problem.

    Of course >> sudo crontab -e >> open cron config for root
    crontab -e >> open cron config or non-root

    Maybe have you put the exec string in the wrong user?

    ¯¯ÅndçŒd Cíld®®

    "What do you look like?"
    "It depends on who is looking."

    --- Mystic BBS v1.12 A31 (Raspberry Pi)
    * Origin: Miskatonic BBS | telnet://rasppi.servebbs.org (21:1/165)
  • From Grud@21:1/171 to Indrid Cold on Wednesday, September 21, 2016 15:43:00
    Maybe have you put the exec string in the wrong user?


    Well I have no problem editing my crontab for the bbs user, but it sounds
    like your script has a nice way of checking and restarting the service if it should go down. I would be curious to see how you do that.

    I can just crontab it to run the mrc server/client and just hope that it
    stays running without problems. Doesn't seem like the most elegant solution though.

    --- Mystic BBS v1.11 (Raspberry Pi)
    * Origin: : : ::] phaseshift BBS [:: : : (21:1/171)