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

Deb/RPM services #149

Open
jelu opened this issue Mar 1, 2017 · 3 comments
Open

Deb/RPM services #149

jelu opened this issue Mar 1, 2017 · 3 comments

Comments

@jelu
Copy link
Member

jelu commented Mar 1, 2017

Get the package running as a service using relevant ways in the different dists.

SUSE/RedHat example: https://build.opensuse.org/package/view_file/server:monitoring/nsca-ng/nsca-ng.spec?expand=1

@freejoins
Copy link

And for FreeBSD start as a service may use like this:

#!/bin/sh
# PROVIDE: dsc
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to
# enable dsc:
#
# dsc_enable (bool): Set to NO by default. Set it to YES to enable dsc.
#
#

. /etc/rc.subr

name="dsc"
rcvar=dsc_enable

command="/usr/local/bin/${name}"
required_files="/usr/local/etc/dsc/${name}.conf"
config="/usr/local/etc/dsc/${name}.conf"
pidfile="/var/run/${name}.pid"
command_args=" ${config}"

load_rc_config $name

: ${dsc_enable="NO"}

run_rc_command "$1"

@danhanks
Copy link

Simplistic systemd unit file for dsc (for CentOS7+ and others):

[Unit]
Description=DNS Stats Collector
After=local-fs.target
After=syslog.target
After=network.target

[Service]
Type=forking
ExecStart=/usr/bin/dsc /etc/dsc/dsc.conf

[Install]
WantedBy=multi-user.target

@tacerus
Copy link

tacerus commented Feb 17, 2021

@danhanks Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants