Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop daemonizing #14

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To interact with the protocol you need to execute the `pim-dm` command. You may

#### Start protocol process

In order to start the protocol you first need to explicitly start it. This will start a daemon process, which will be running in the background. The command is the following:
In order to start the protocol you first need to explicitly start it. This will start pim-dm process, which will be running in foreground. The command is the following:
```
sudo pim-dm -start [-mvrf MULTICAST_TABLE_ID] [-uvrf UNICAST_TABLE_ID]
```
Expand All @@ -57,6 +57,23 @@ If `-uvrf` is not defined, the default unicast table id will be used (table id 2
After starting the protocol process, if the default multicast table is not used, the following commands (for adding interfaces and listing state) need to have the argument `-mvrf` defined to specify the corresponding daemon process.


#### Run in background

To start pim-dm process in background, one can use
```
sudo setsid pim-dm -start [-mvrf MULTICAST_TABLE_ID] [-uvrf UNICAST_TABLE_ID] &
```
or run it with a daemonizing tool (systemd, supervisord, OpenRC ...).

For systemd you can simply run
```
sudo systemd-run pim-dm -start
```
or copy [pim-dm.service](daemon/pim-dm.service) to `/usr/lib/systemd/system/pim-dm.service` and then start pim-dm process with command:
```
sudo systemctl start pim-dm
```
leoplo marked this conversation as resolved.
Show resolved Hide resolved


#### Multi daemon support

Expand Down
10 changes: 10 additions & 0 deletions daemon/pim-dm.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Multicast routing daemon
#ConditionPathExists=/etc/pim-dm/conf.yaml

[Service]
#WorkingDirectory=/etc/pim-dm
#ExecStart=/usr/local/bin/pim-dm -config conf.yaml
ExecStart=/usr/local/bin/pim-dm -start
ExecStop=/usr/local/bin/pim-dm -stop

Loading