Page MenuHomeDevCentral

Provide services for eggdrop
ClosedPublic

Authored by dereckson on Nov 19 2017, 04:36.
Tags
None
Referenced Files
F3787490: D1236.diff
Tue, Nov 26, 18:28
Unknown Object (File)
Mon, Nov 25, 01:23
Unknown Object (File)
Sat, Nov 23, 07:02
Unknown Object (File)
Sat, Nov 23, 06:40
Unknown Object (File)
Wed, Nov 20, 00:08
Unknown Object (File)
Sun, Nov 17, 17:59
Unknown Object (File)
Wed, Nov 13, 01:27
Unknown Object (File)
Tue, Nov 12, 12:50
Subscribers
None

Details

Summary

Compatible only with FreeBSD.

The rc service provided has an instances parameter to write all
the eggdrop names, so a unique service can be used for all of them.
The code is based on the MySQL FreeBSD port instances handling.

service eggdrop status will get an overview of all the eggdrops
in one command. It also allows to run them at reboot or stop it
as once.

Ref T1309

Test Plan
  • service eggdrop status
  • service eggdrop status Wearg
  • TC2 has been launched through /usr/local/etc/rc.d/eggdrop start TC2

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Passed
Unit
No Test Coverage
Branch
viperserv-services (branched from master)
Build Status
Buildable 1968
Build 2216: arc lint + arc unit

Event Timeline

The daemon command starts the process with / as $HOME instead of /var/run/tc2:

TC2
04:26 <dereckson> .env
04:26 <TC2> RC_PID    10900
04:26 <TC2> HOME      /
04:26 <TC2> LOGNAME   tc2
04:26 <TC2> PWD       /srv/viperserv
04:26 <TC2> GROUP     nasqueron-irc
…
04:26 <TC2> PATH      /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin://bin

That has two impacts:

  • $PATH doesn't include /var/run/tc2/bin ((//bin instead)
  • pid file isn't created at /var/run/tc2/TC2.pid (//TC2.pid instead, a directory without write access)

Set HOME environment variable

The following environment has been defined by the last service update.

HOME is correct, PATH isn't.

01:12 <dereckson> .env
01:12 <TC2> RC_PID    95947
01:12 <TC2> HOME      /var/run/tc2
01:12 <TC2> LOGNAME   tc2
01:12 <TC2> PWD       /srv/viperserv
01:12 <TC2> GROUP     nasqueron-irc
01:12 <TC2> BLOCKSIZE K
01:12 <TC2> VENDOR    amd
01:12 <TC2> HOST      ysul.nasqueron.org
01:12 <TC2> HOSTTYPE  FreeBSD
01:12 <TC2> SHLVL     1
01:12 <TC2> OLDPWD    /
01:12 <TC2> MACHTYPE  x86_64
01:12 <TC2> OSTYPE    FreeBSD
01:12 <TC2> PATH      /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin://bin
01:12 <TC2> TZ        UTC0
01:12 <TC2> USER      tc2
01:12 <TC2> PAGER     more
01:12 <TC2> EDITOR    vi

Manually set /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/$eggdrop_user_home/bin as path.

Set also PATH env variable in addition to HOME

PATH is now correct:

01:00 <TC2> PATH /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/var/run/tc2/bin

This revision is now accepted and ready to land.Nov 22 2017, 01:03
This revision was automatically updated to reflect the committed changes.