distribworks/dkron

Dkron service failing on passing config file under [service] in dkron.service file under /lib/systemd/system

pankajsh94 opened this issue · 3 comments

below is my dkron.service file -

[Unit]
Description=Dkron Agent
Documentation=https://dkron.io
After=network.target

[Service]
User=root
ExecStart=/usr/bin/dkron agent --config /etc/dkron/dkron.yml
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target

Can you be more specific on the error you're experiencing? Are you using the official packages?

I have modified the dkron.service file to add pass my yaml as a config below is the file -

[Unit]
Description=Dkron Agent
Documentation=https://dkron.io
After=network.target

[Service]
User=root
ExecStart=/usr/bin/dkron agent --config /etc/dkron/dkron.yml
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target

I have added the data_dir in dkron.yml below is the file -

Dkron example configuration file

This node is running in server mode

server: true
ui: true
listen_address: 0.0.0.0:8080
data_dir: /etc/dkron/data

Provides the number of expected servers in the datacenter.

Either this value should not be provided or the value must agree with other servers in the cluster.

When provided, Dkron waits until the specified number of servers are available and then bootstraps the cluster.

This allows an initial leader to be elected automatically. This flag requires server mode.

bootstrap-expect: 1

bind-addr: "{{ GetPrivateIP }}:8946"

log-level: debug
log_file: /var/log/dkron/dkron.log

Now this data_dir is not getting picked up and it is storing the jobs data in root (/) directory please help me how can I set my custom yaml to change the data_dir

Hey you can not set the config file like that, there's pre-defined locations for the config file check this section in the docs https://dkron.io/docs/basics/configuration#config-file-location