It would be nice if this script can be uploaded to CVS repo. I'll contribute this to the wiki also.
Yes, I agree. Can you email it to me (rob {at} synchro {dot} net) or just upload to vert?
I'm assuming this new script should go under install/systemd or something similar?
Yes, I agree. Can you email it to me (rob {at} synchro {dot} net) or just upload to vert?
Re: Contribution: systemd startup file
By: Digital Man to Karloch on Sun Dec 11 2016 19:04:14
Yes, I agree. Can you email it to me (rob {at} synchro {dot} net) or just upload to vert?
I have uploaded the file at the Synchronet 3rd Party file area in VERT, the name is sbbssysd.zip.
I have applied the corrections according to the problems I was facing. The final file looks like this:
======== sbbs.service
[Unit]
Description=Synchronet BBS service
Documentation=man:sbbs
After=syslog.target network.target
[Service]
Type=forking
Environment=SBBSROOT=/sbbs SBBSCTRL=/sbbs/ctrl
User=sbbs
Group=sbbs
PermissionsStartOnly=true
ExecStartPre=/sbin/setcap 'cap_net_bind_service=+ep' /sbbs/src/sbbs3/gcc.linux.x64.exe.release/sbbs
Any particular reason you need that abosolute path (above)? That's a very system specific element that makes this file require modification by most/many sysops to be utilized.
Re: Contribution: systemd startup file
By: Digital Man to Karloch on Thu Dec 15 2016 18:16:34
Any particular reason you need that abosolute path (above)? That's a very system specific element that makes this file require modification by most/many sysops to be utilized.
I know it is not convenient, but setcap doesn't support symlinks:
$ setcap --help
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]
Note <filename> must be a regular (non-symlink) file.
readlink dereferences the symlink and puts the output in stdout, the | redirects the stdout of readlinkt to the stdin of xargs which thenexecutes the
setcap with the last argument being replaced with the input from stdin.in
And of course, you'd have to initialize the SBBSROOT environment variable
their somewhere, but only have to specify the (potentiallysystem-specific)
path in one place would be preferable.
Hello Digital,
On Fri, 16 Dec 2016 17:33:18 -0800, Digital Man -> Karloch wrote:
readlink dereferences the symlink and puts the output in stdout, the | redirects the stdout of readlinkt to the stdin of xargs which thenexecutes the
setcap with the last argument being replaced with the input from stdin.
And of course, you'd have to initialize the SBBSROOT environment variablein
their somewhere, but only have to specify the (potentiallysystem-specific)
path in one place would be preferable.
I'm beginning to wonder if people are looking way too far into this. Service files for systemd are supposed to be easy, and not like the old sysvinit stuff.
This is what I use here without any issues whatsoever:
--[ /ets/systemd/system/sbbs.service ]--
[Unit]
Description=Synchronet BBS Software
After=network.target
[Service]
EnvironmentFile=/etc/sysconfig/sbbs
Type=forking
ExecStart=/sbbs/exec/sbbs d
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
--[ End ]--
And /etc/sysconfig/sbbs:
--[ /etc/sysconfig/sbbs ]--
SBBSCTRL=/sbbs/ctrl
SBBSNODE=/sbbs/node1
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/sbbs/exec
TERM=ansi-bbs
--[ End ]--
Haven't had an issue with it yet, and keeping it simple makes for a lot less headaches.
Regards,
Nick
| Sysop: | Ragnarok |
|---|---|
| Location: | Dock Sud, Bs As, Argentina |
| Users: | 137 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 105:27:39 |
| Calls: | 15,362 |
| Files: | 20,057 |
| D/L today: |
19 files (6,438K bytes) |
| Messages: | 1,798,198 |