Artix Linux Forum

Artix Linux => Package management => Topic started by: gendalf on 29 December 2021, 17:44:51

Title: tftp-hpa. convert systemd into runit
Post by: gendalf on 29 December 2021, 17:44:51
Hello. I want use tftp-hpa from arch. But it use systemd units. Can anyone help me convert systemd utits into runit?

tftpd.service:

[Unit]
Description=hpa's original TFTP daemon
After=network.target

tftpd.socket:

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/tftpd
ExecStart=/usr/bin/in.tftpd --listen $TFTPD_ARGS

[Install]
WantedBy=multi-user.target


[Unit]
Description=hpa's original TFTP daemon
Conflicts=tftpd.service

[Socket]
ListenDatagram=69

[Install]
WantedBy=sockets.target

Title: Re: tftp-hpa. convert systemd into runit
Post by: gendalf on 30 December 2021, 02:42:00
I try create runit file:

#!/bin/sh
exec in.tftpd -l -s /srv/tftp/

in.tftpd not  run. RSM shows that the service is not running...   tftp-hpa  state-down.
But in.tftpd -l -s /srv/tftp/ runs from command line (root)
Title: Re: tftp-hpa. convert systemd into runit
Post by: strajder on 30 December 2021, 07:11:00
Please don't post multiple posts in succession. Use the "Quick Edit" or "Modify" menu item in the bottom right corner of your post instead.
Title: Re: tftp-hpa. convert systemd into runit
Post by: capezotte on 30 December 2021, 11:02:54
Quote
Type=forking

There's the problem. Due to runit's design, you must find a way to make services foreground/non-forking (in systemd lingo, Type=simple) for them to work properly.

You should probably read the documentation on your end to be sure, but this manual (https://linux.die.net/man/8/in.tftpd) states that replacing -l with -L will fix that. Remember to kill any dangling in.tftpd processes that might be using the port.
Title: Re: tftp-hpa. convert systemd into runit
Post by: gendalf on 01 January 2022, 04:26:42
Works. Thank you!!!