Skip to content

Commit

Permalink
ARCHIVE: Add systemd configuration files for eosarchived daemon. Fixe…
Browse files Browse the repository at this point in the history
…s EOS-2696
  • Loading branch information
esindril committed Oct 2, 2018
1 parent f791041 commit 9105265
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 3 deletions.
12 changes: 12 additions & 0 deletions archive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ if(PYTHONSITEPKG_FOUND)
PERMISSIONS OWNER_READ OWNER_WRITE
GROUP_READ
WORLD_READ)

# Installing files depending on service manager (systemd or sysVinit)
set(SYSTEMD_DIR /usr/lib/systemd/)

if(EXISTS ${SYSTEMD_DIR})
install(FILES eosarchived_env.sysconfig
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/sysconfig/
RENAME eosarchived_env)

install(FILES eosarchived.service
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system/)
endif()
endif()
40 changes: 40 additions & 0 deletions archive/eosarchived.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ----------------------------------------------------------------------
# File: eosarchived.service
# Author: Elvin Sindrilaru - CERN
# ----------------------------------------------------------------------
#
# ************************************************************************
# * EOS - the CERN Disk Storage System *
# * Copyright (C) 2018 CERN/Switzerland *
# * *
# * This program is free software: you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation, either version 3 of the License, or *
# * (at your option) any later version. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU General Public License *
# * along with this program. If not, see <http://www.gnu.org/licenses/>.*
# ************************************************************************
[Unit]
Description=EOS archiver daemon
After=network-online.target local-fs.target
Wants=network-online.target local-fs.target

[Service]
WorkinDirectory=/var/eos/
LogDirectory=eos/archive/
EnvironmentFile=/etc/sysconfig/eosarchived_env
ExecStart=/usr/bin/eosarchived.py
Type=simple
User=eosarchi
Group=c3
Restart=on-abort
RestartSec=5
LimitNOFILE=65000
KillMode=Mixed
SuccessExitStatus=KILL
22 changes: 22 additions & 0 deletions archive/eosarchived_env.sysconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Options for the eosarchived daemon
# EOSARCHIVED_OPTIONS=

# Enable core dumping
DAEMON_COREFILE_LIMIT="unlimited"

# Directory where log files are saved
LOG_DIR="/var/log/eos/archive/"

# This directory must match the one set in xrd.cf.mgm as it is used for the
# communication between the MGM and the eosarchived daemon
EOS_ARCHIVE_DIR=/var/eos/archive/

# Configuration file which can be modified while the daemon is running and
# whose changes are automatically picked up by new transfers
EOS_ARCHIVE_CONF=/etc/eosarchived.conf

# This is the location of the archive keytab file containing just **one** entry
# for the user account under which the eosarchived daemon is running. The same
# entry need to be present in the eos.keytab file so that the eosarchived can
# have full access to the EOS.
XrdSecSSSKT=/etc/eos-archive.keytab
11 changes: 8 additions & 3 deletions eos.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,16 @@ The EOS archive daemon.
%{_bindir}/eosarchived.py
%{_bindir}/eosarch_run.py
%{_bindir}/eosarch_reconstruct.py
%config(noreplace) %{_sysconfdir}/sysconfig/eosarchived
%config(noreplace) %{_sysconfdir}/eosarchived.conf
%if %{use_systemd}
%{_prefix}/lib/systemd/system/eosarchived.service
%config(noreplace) %{_sysconfdir}/sysconfig/eosarchived_env
%else
%{_sysconfdir}/rc.d/init.d/eosarchived
%dir %attr(755,daemon,daemon) %{_localstatedir}/log/eos/archive/
%dir %attr(755,daemon,daemon) %{_localstatedir}/eos/archive/
%config(noreplace) %{_sysconfdir}/sysconfig/eosarchived
%endif
%dir %attr(755,eosarchi,c3) %{_localstatedir}/log/eos/archive/
%dir %attr(755,eosarchi,c3) %{_localstatedir}/eos/archive/

%post -n eos-archive
case "$1" in
Expand Down

0 comments on commit 9105265

Please sign in to comment.