Re: Replacement of "/etc/init.d/otrs" for systemd

"Elias Probst" <[email protected]> Thu, 30 Apr 2015 08:17:01 +0200
Newsgroups gmane.comp.otrs.devel
Message-ID <[email protected]>
This service unit just executes as a oneshot "Cron.sh".

The IMHO proper solution would be instead to create "timer units" [1]
which do whatever the old cron jobs did and to ingore Cron.sh (or only
use it to enable the respective timer units) on systemd based systems.

The OTRS Scheduler would then be started as a regular (Type=simple)
systemd service, for which a service unit still needs to be created.

On top of that, it might make sense to make the Scheduler "systemd
aware" (using Systemd::Daemon), so the fragile PIDfile/timeout-based
self-health check of the Scheduler could be disabled when running under
systemd and the Scheduler could use Systemd::Daemon->notify() [2]
instead to let systemd know about it's status (which is a nice addon on
top of systemd's own process monitoring).

Another nice systemd-related addition could be support to log to
journald [3] instead of SysLog/File.


[1] http://www.freedesktop.org/software/systemd/man/systemd.timer.html
[2] http://www.freedesktop.org/software/systemd/man/sd_notify.html
[3] http://0pointer.de/blog/projects/journalctl.html

Best regards
Elias

On 12/30/2014 04:22 AM, Hisatoshi Onishi wrote:
> Hi all,
> 
> I found the script file "/etc/init.d/otrs" won't work well which
> includes in RPM package for RHEL7/CentOS7.
> 
> For detail, value of $OTRS_USED_WEBSERVER_TEST in "/etc/sysconfig/otrs"
> is not effective. Because RHEL7/CentOS7 has changed to systemd, so
> output message also does.
> 
> Normal solution for this is modify script file to fit. But, most of
> Linux distributions might be shift too.
> I wrote very simple script file for systemd as a prototype. Because of
> focused only for start or stop (registering or deleting cron jobs of
> OTRS running user), functions below doesn't include.
> - Check existing/size for various files.
> - Web server running check if enabled.
> - DB server connecting check.
> - Cleanup spooled messages with sending mail.
> 
> It has omitted any other servers running check since it depends on the
> environment.
> But, it must require such as httpd+mariadb.
> 
> I'll attach in this mail because I don't know what repository this must
> be classified.
> Please place it under directory "/usr/lib/systemd/system". Permission
> for executing is not required.
> 
> If target ML is wrong, please notify.
> 
> -- 
> Hisatoshi Onishi
> E-Mail: [email protected] <mailto:[email protected]>
> 
> 
> _______________________________________________
> OTRS mailing list: dev - Webpage: http://otrs.org/
> Archive: http://lists.otrs.org/pipermail/dev
> To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
>

_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJVQcjiAAoJEILFEoJlEbrb3mYP/RxG5N78jJqMy25wL0NftKT9
HXeJTmOYeFeOMz+yLeboAY46fR8BoSLyj6+dqzSMwOIfdguJMvJK2XxYFYZ1dv3e
tK/LgjbmQc3dPikYP7Ug1iJDYDYoQQRKla4UuZeLGq0xZQrcvNVbEIxll+OvIqA5
chpzh7K8f2jSYaYUaua/7swImFXeF+/dInIOLYY8FnvZLUD8wfe25ZKebQgaKSkI
PZOvmjCG0LXwowUIWCBfLx1lji8creiIKVgSb21F5FsKU1Qq7AqhfXFWlwQflaL+
WmUGYIl2hZJVkPWzS9ePoXHluxcNikb1haa/Q/Um+iU9Xka14D3TfoEcHesbHCft
4pLPlJ3uZAVbPBuDOMGf7NNM9qiIisBJBBlrEynlH2H3Umzjz8IvoMB24w64zfDB
S7b32Yvd8qEKE3QGVmDtcfwqR7ZW60xa6sqKe3HLjrslot1BclqGV9pd7WDLojrd
uj0mKodp4uR5qkk4l6pucm1ARCvDs2QoJOnjOyoMhVfVMFXPdW57VcLvmvwXlZQJ
pUXfJMafIAdDBQw9baCbfY0oDW9NXwfs93pLJrt6dik3kKIIbmwE+1m0nIyZffGa
FmGhQEc87lg9PDLijUxGhS4HmdVkzwVAotwBH59o5l8/G7nXMem5rbzy/UmWxsEj
PtmE9mV8exRswqlvupwd
=0j9Q
-----END PGP SIGNATURE-----