How create/use services with OpenRC?

Viewed 3049

I'm used to create and use services with systemd like that :

XXXX.service :

[Unit]
Description=Report Service

[Service]
Type=Simple
ExecStart=/path/to/my/script.sh

XXXX.timer :

[Unit]
Description=Timer for Report Service

[Timer]
OnCalendar=*-*-* 2:00:00
Persistent=true

[Install]
WantedBy=timers.target

But now, I've to use OpenRC and I don't really understand how it works !

There is someone to explain how OpenRC work and based on my example, how to create a service with OpenRC, in order to learn how to use it ?

Thanks a lot !

1 Answers

Probably the best option to learn is this.

The base script is like this:

#!/sbin/openrc-run
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

name="service"
description=""
command="/path/to/dir/"
command_args="${service_args}"
#command_user="user:user"

depend() {

}
Related