Skip to content
Snippets Groups Projects
Commit d8047c2d authored by Anastasia Karachaliou's avatar Anastasia Karachaliou
Browse files

cta-rmcd rpm working

parent 4d9f467d
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ if [ ! -e /etc/buildtreeRunner ]; then
yum-config-manager --enable castor
# Install missing RPMs
yum -y install mt-st mtx lsscsi sg3_utils castor-rmc-server
yum -y install mt-st mtx lsscsi sg3_utils cta-rmcd
fi
# source library configuration file
......
......@@ -290,30 +290,29 @@ Utilities to faciliate working with the mediachangers
%attr(0644,root,root) %doc /usr/share/man/man1/cta-mediachanger-dismount.1cta.gz
%attr(0644,root,root) %doc /usr/share/man/man1/cta-mediachanger-mount.1cta.gz
%package -n cta-rmc
Summary: Tools to faciliate working with rmc and smc in cta
%package -n cta-rmcd
Summary: Tools to faciliate working with rmcd and smc in cta
Group: Application/CTA
%description -n cta-rmc
Requires: logrotate
Requires(pre): /usr/bin/getent, /usr/sbin/groupadd, /usr/sbin/useradd
%description -n cta-rmcd
CERN Tape Archive:
Tools to faciliate working with rmc and smc in cta
%files -n cta-rmc
%attr(0755,root,root) %{_bindir}/rmcd
Tools to faciliate working with rmcd and smc in cta
%pre -n cta-rmcd
/usr/bin/getent group cta || /usr/sbin/groupadd cta
/usr/bin/getent passwd cta || /usr/sbin/useradd -s /bin/nologin -c "CTA system account" -g cta cta
%files -n cta-rmcd
%attr(0755,root,root) %{_bindir}/cta-rmcd
#%attr(0755,root,root) %{_bindir}/cta-rmcd
%attr(0755,root,root) %{_bindir}/smc
%attr(0755,cta,cta) %dir /var/log/cta
%attr(0644,root,root) %doc /usr/share/man/man1/rmcd.1cta.gz
%attr(0644,root,root) %doc /usr/share/man/man1/smc.1cta.gz
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cta/cta-rmcd.conf.example
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cta/cta-rmcd.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cta/cta-smc.conf.example
%attr(0644,root,root) /etc/sysconfig/cta-rmc
%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/cta-rmc
#%package -n cta-smc
#Summary: Tools to faciliate working with smc in cta
#Group: Application/CTA
#%description -n cta-smc
#CERN Tape Archive:
#Tools to faciliate working with smc in cta
#%files -n cta-smc
#%attr(0755,root,root) %{_bindir}/smc
##%attr(0644,root,root) %doc /usr/share/man/man1/rmcd.1cta.gz
%attr(0644,root,root) /etc/sysconfig/cta-rmcd
%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/cta-rmcd
%attr(0644,root,root) /etc/systemd/system/cta-rmcd.service
%endif
......@@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required (VERSION 2.6)
#install (TARGETS ctarmccommon DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
include_directories (${PROJECT_SOURCE_DIR}/mediachanger/castorrmc/h)
set (RMCD_SRC_FILES
......@@ -28,13 +27,18 @@ set (RMCD_SRC_FILES
rmc_serv.c
rmc_smcsubr.c
)
add_executable(rmcd ${RMCD_SRC_FILES})
target_link_libraries(rmcd ctarmccommon)
install (FILES cta-rmcd.conf.example DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cta)
add_executable(cta-rmcd ${RMCD_SRC_FILES})
target_link_libraries(cta-rmcd ctarmccommon)
#install (FILES cta-rmcd.conf.example DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cta)
install (FILES cta-rmcd.conf DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cta)
install (FILES cta-smc.conf.example DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cta)
install (TARGETS rmcd DESTINATION /usr/bin)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rmcd.1cta DESTINATION /usr/share/man/man1)
install (TARGETS cta-rmcd DESTINATION /usr/bin)
#install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/rmcd.1cta DESTINATION /usr/share/man/man1)
install (FILES rmcd.1cta DESTINATION /usr/share/man/man1)
install (FILES cta-rmcd.logrotate DESTINATION /etc/logrotate.d RENAME cta-rmcd)
install (FILES cta-rmcd.sysconfig DESTINATION /etc/sysconfig RENAME cta-rmcd)
install (FILES cta-rmcd.service DESTINATION /etc/systemd/system)
set (SMC_SRC_FILES
rmc_dismount.c
......
/var/log/cta/cta-rmc*.log {
compress
daily
missingok
rotate 500
delaycompress
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
[Unit]
Description=CERN Tape Archive (CTA) rmcd daemon
After=syslog.target network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/cta-rmcd
ExecStart=/usr/bin/cta-rmcd ${CTA_RMCD_OPTIONS}
LimitCORE=infinity
Type=forking
Restart=no
[Install]
WantedBy=default.target
# Arguments for the rmcd server daemon
# -smc_ldr is the picker device as defined in /dev.
# -f keep process in the foreground, do not fork.
#CTA_RMCD_OPTIONS="smc_ldr"
# The CERN Tape Archive (CTA) project
# Copyright (C) 2015 CERN
#
# 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/>.
################################################################################
#
# CTA Sample Configuration File
#
################################################################################
# The log mask. Logs with a level lower than this value will be masked.
# Possible values are:
# EMERG
# ALERT
# CRIT
# ERR
# WARNING
# NOTICE
# INFO
# DEBUG
# USERERR
#
# Please note that the USERERR log level is equivalent to NOTICE because it is
# a convention of CTA to use log level NOTICE to label user errors.
#
# taped LogMask INFO
#! /bin/sh
#
#/******************************************************************************
# rmcd.init
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# 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 2
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# chkconfig: 345 71 34
# description: RMC server daemon
#
# @author castor dev team
#*****************************************************************************/
# Source function library.
. /etc/rc.d/init.d/functions
# Variables
prog="rmcd"
export DAEMON_COREFILE_LIMIT="unlimited"
RETVAL=0
# Source sysconfig files
if [ -f /etc/sysconfig/castor ]; then
. /etc/sysconfig/castor
fi
if [ -f /etc/sysconfig/$prog ]; then
. /etc/sysconfig/$prog
fi
start() {
# Run daemon
echo -n $"Starting $prog: "
cd /var/log/castor
daemon --user=stage /usr/bin/$prog $RMCD_OPTIONS
# Write the pid to a file.
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
pid=`ps -eo pid,ppid,comm | egrep " 1 $prog\$" | awk '{print $1}'`
rm -f /var/run/$prog.pid
if [ -n "$pid" ]; then
echo $pid > /var/run/$prog.pid
RETVAL=0
else
RETVAL=1
fi
fi
[ $RETVAL -eq 0 ] && success $"$base startup" || failure $"$base startup"
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ -f /var/lock/subsys/$prog ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
restart() {
stop
start
}
# See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
RETVAL=$?
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/$prog ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $RETVAL
# Options to pass to the rmc daemon
#RMCD_OPTIONS=
......@@ -24,9 +24,6 @@ install (FILES cta-taped.1cta DESTINATION /usr/share/man/man1)
install (FILES cta-taped.logrotate DESTINATION /etc/logrotate.d RENAME cta-taped)
install (FILES cta-taped.sysconfig DESTINATION /etc/sysconfig RENAME cta-taped)
install (FILES cta-taped.service DESTINATION /etc/systemd/system)
install (FILES cta-rmc.logrotate DESTINATION /etc/logrotate.d RENAME cta-rmc)
install (FILES cta-rmc.sysconfig DESTINATION /etc/sysconfig RENAME cta-rmc)
#install (FILES cta-rmc.service DESTINATION /etc/systemd/system)
# CTA's cta-taped system tests.
add_library(cta-tapedSystemTests SHARED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment