Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 2015 14:46:39 +0100
From:      Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com>
To:        timp87@gmail.com, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: How to control and setup service?
Message-ID:  <55F972BF.8070302@NTLWorld.com>
References:  CAAoTqfvxUznJp%2BtguAaYQ=5HfKXTG%2BGxY644wvqm4e9=E8WuHw@mail.gmail.com

next in thread | raw e-mail | index | archive | help
Pavel Timofeev:
> As a user I would love to have a cool tool to control and configure  > services in way like OpenBSD's rcctl(8) does

As long as you are prepared to live with replacing those rc.d scripts, 
you have almost exactly that already available.  Here are some example 
commands illustrating that and various other shims that are available.  
(Yes, there is in fact a mysql service bundle supplied.)

# system-control enable mysql cyclog@mysql
# systemctl enable mysql cyclog@mysql
# initctl enable mysql cyclog@mysql
# svcadm enable mysql cyclog@mysql
# rcctl enable mysql cyclog@mysql

# system-control start mysql cyclog@mysql
# systemctl start mysql cyclog@mysql
# initctl start mysql cyclog@mysql
# svcadm start mysql cyclog@mysql
# service mysql start ; service cyclog@mysql start

# system-control status mysql
# systemctl status mysql
# initctl status mysql
# svcadm status mysql
# rcctl status mysql

# system-control is-enabled mysql
# systemctl is-enabled mysql
# initctl is-enabled mysql
# svcadm is-enabled mysql

# system-control set-service-env tinydns IP 127.53.0.1
# rcctl set tinydns IP 127.53.0.1

# system-control print-service-env dnscache
# rcctl get dnscache

And here are where you go next:

* http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh.html
* 
http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/freebsd-binary-packages.html
* 
http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/timorous-admin-installation-how-to.html
* 
http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/worked-example.html
* 
http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/commands.html#ControlStatus
* 
http://homepage.ntlworld.com./jonathan.deboynepollard/Softwares/nosh/roadmap.html#FreeBSDrc.d

Read.  Enjoy.  Any contributions towards whittling away the remaining 
rc.d scripts on that list welcomed.

If you want to try out flow capture, take a file named 
flow-capture.service containing

> [Unit]
 > Description=%p daemon for capturing traffic flow data > > [Service]
 > User=%p
 > EnvironmentDirectory=env
 >ExecStart=%p $flags ${datadir:+-w} $datadir "$localip/$remoteip/$port" 
 > > [Install]
 >WantedBy=workstation.target

and run it through

# system-control convert-systemd-units  --bundle-root /var/local/sv/ 
--no-systemd-quirks ./flow-capture.service

Then experiment with

# pw useradd flow-capture
# rcctl set flow-capture flags "-e 2200 -n 23 -N 0 -V 5"
# rcctl set flow-capture datadir "/storage/flows/all_routers"
# rcctl set flow-capture port "8787"
# rcctl set flow-capture localip "0"
# rcctl set flow-capture remoteip "0"
# rcctl get flow-capture
# system-control cat flow-capture
# rcctl enable flow-capture
# systemctl start flow-capture
# system-control status flow-capture




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55F972BF.8070302>