Commit 4d9f467d authored by Anastasia Karachaliou's avatar Anastasia Karachaliou
Browse files

Get configuration for rmcd in CTA rpms from the file cta-rmcd.conf instead of castor.conf

parent 11ff435f
......@@ -303,6 +303,8 @@ Tools to faciliate working with rmc and smc in cta
%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-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
......
......@@ -34,6 +34,8 @@
#include <sys/stat.h>
#include "rmc_send_scsi_cmd.h"
#define PATH_CONF "cta-rmcd.conf"
/* Forward declaration */
static int rmc_getreq(const int s, int *const req_type, char *const req_data,
char **const clienthost);
......@@ -136,7 +138,7 @@ int rmc_main(const char *const robot)
sin.sin_family = AF_INET ;
{
const char *p;
if ((p = getenv ("RMC_PORT")) || (p = getconfent ("RMC", "PORT", 0))) {
if ((p = getenv ("RMC_PORT")) || (p = getconfent_fromfile (PATH_CONF,"RMC", "PORT", 0))) {
sin.sin_port = htons ((unsigned short)atoi (p));
} else {
sin.sin_port = htons ((unsigned short)RMC_PORT);
......
......@@ -25,6 +25,7 @@
#include "smc_constants.h"
#define RBT_XTRA_PROC 10
#define PATH_CONF "cta-smc.conf"
static struct smc_status smc_status;
static const char *smc_msgaddr;
......@@ -442,7 +443,7 @@ int smc_find_cartridge(
func[sizeof(func) - 1] = '\0';
/* Skip the 0xB6 cdb command if the tape library is Spectra like */
smcLibraryType = getconfent("SMC","LIBRARY_TYPE",0);
smcLibraryType = getconfent_fromfile(PATH_CONF,"SMC","LIBRARY_TYPE",0);
if (NULL != smcLibraryType &&
0 == strcasecmp(smcLibraryType,"SPECTRA")) {
rc = smc_find_cartridgeWithoutSendVolumeTag (fd, rbtdev, find_template, type, start, nbelem,
......
......@@ -17,6 +17,7 @@
#include "rmc_constants.h"
#include "serrno.h"
#define PATH_CONF "cta-rmcd.conf"
/* send2tpd - send a request to the SCSI media changer server and wait for the reply */
int send2rmc(
......@@ -30,6 +31,7 @@ int send2rmc(
int c;
char func[16];
char *getconfent();
char *getconfent_fromfile();
char *getenv();
struct hostent *hp;
int magic;
......@@ -44,7 +46,7 @@ int send2rmc(
strncpy (func, "send2rmc", 16);
sin.sin_family = AF_INET;
if ((p = getenv ("RMC_PORT")) || (p = getconfent ("RMC", "PORT", 0))) {
if ((p = getenv ("RMC_PORT")) || (p = getconfent_fromfile (PATH_CONF,"RMC", "PORT", 0))) {
sin.sin_port = htons ((unsigned short)atoi (p));
} else {
sin.sin_port = htons ((unsigned short)RMC_PORT);
......
......@@ -19,6 +19,7 @@
/* exit codes */
#define USERR 1
#define PATH_CONF "cta-smc.conf"
extern char *optarg;
......@@ -78,7 +79,7 @@ static int smc_qdrive (
printf ("Drive Ordinal\tElement Addr.\tStatus\t\tVid\n");
useSpectraLib=0;
smcLibraryType = getconfent("SMC","LIBRARY_TYPE",0);
smcLibraryType = getconfent_fromfile(PATH_CONF,"SMC","LIBRARY_TYPE",0);
if (NULL != smcLibraryType &&
0 == strcasecmp(smcLibraryType,"SPECTRA")) {
useSpectraLib = 1;
......
......@@ -24,6 +24,9 @@ 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment