diff --git a/init.d/sc-filemover.service b/init.d/sc-filemover.service deleted file mode 100644 index 29198ff8579b9603f25382fc1948e3f31eabdc87..0000000000000000000000000000000000000000 --- a/init.d/sc-filemover.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Wrapper script to run scouting filemover - -[Service] -Type=simple -PIDFile=/var/log/sc-filemover/pid -ExecStart=/opt/sc-filemover/scripts/runFileMover.sh -User=scouter -Group=scouter -WorkingDirectory=/opt/sc-filemover/scripts -Restart=always -RestartSec=10 - -[Install] -WantedBy=multi-user.target diff --git a/scripts/fileMover.py b/scripts/fileMover.py deleted file mode 100755 index 37cb789016712b75af0a077a7b3108e486212862..0000000000000000000000000000000000000000 --- a/scripts/fileMover.py +++ /dev/null @@ -1,38 +0,0 @@ -#! /usr/bin/python - -if __name__ == "__main__": - from os import listdir - from os.path import isfile, join - import time - import os - - while True: - try: - onlyfiles = [f for f in listdir('/fff/ramdisk/scdaq') if isfile(join('/fff/ramdisk/scdaq', f)) and f.endswith('.dat')] - if len(onlyfiles)==0: - print "waiting for new file..." - time.sleep(30) - print onlyfiles - for f in onlyfiles: - full_filename = join('/fff/ramdisk/scdaq', f) - outfile = f+'.bz2' - name_without_extension = f.split(".")[0] - subsystem=name_without_extension.split("_")[1] - run_number=name_without_extension.split("_")[2] - - dest_path = join('/store/lustre/l1scout/scdaq/',run_number) - - if not (os.path.exists(dest_path)): - os.mkdir(dest_path) - - dest_name = join(dest_path,outfile) - command = "lbzip2 "+full_filename+" -c > "+dest_name - print "compressing "+full_filename - retval = os.system(command) - if retval==0: - command = "rm "+full_filename - print "deleting "+full_filename - retval = os.system(command) - except OSError as err: - print err - time.sleep(600) diff --git a/scripts/runFileMover.sh b/scripts/runFileMover.sh deleted file mode 100755 index f6c6f31d7d99631db80ab93b1453e1b41ebfe68b..0000000000000000000000000000000000000000 --- a/scripts/runFileMover.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -# This script will start Scouting Data-Taking Software -# - -sudo python fileMover.py diff --git a/scripts/scdaqrpm.sh b/scripts/scdaqrpm.sh index 0d0613e6ba3578920e62852aa91c72d0199067da..9360021d0e3e35af45b38a541174257ffa0fa749 100755 --- a/scripts/scdaqrpm.sh +++ b/scripts/scdaqrpm.sh @@ -87,7 +87,6 @@ for ((i = 0; i < ${NLINES}; i++)); do done PACKAGENAME="scdaq" -PACKAGENAMEFILEMOVER="sc-filemover" cd $SCRIPTDIR/.. BASEDIR=$PWD @@ -95,67 +94,8 @@ BASEDIR=$PWD # create a build area echo "removing old build area" rm -rf /tmp/$PACKAGENAME-build-tmp -rm -rf /tmp/$PACKAGENAMEFILEMOVER-build-tmp echo "creating new build area" mkdir /tmp/$PACKAGENAME-build-tmp -mkdir /tmp/$PACKAGENAMEFILEMOVER-build-tmp -cd /tmp/$PACKAGENAMEFILEMOVER-build-tmp -TOPDIR=$PWD -echo "working in $PWD" - - -# we are done here, write the specs and make the rpm -cat >sc-filemover.spec <<EOF -Name: $PACKAGENAMEFILEMOVER$pkgsuffix -Version: $VER -Release: $REL -Summary: L1 Scouting DAQ filemover -License: gpl -Group: CMS/L1Scouting -Packager: scouter -Source: none -%define _tmppath $TOPDIR/sc-filemover-build -%define debug_package %{nil} -%define __strip /bin/true -BuildRoot: %{_tmppath} -BuildArch: $BUILD_ARCH -AutoReqProv: no -Provides:/opt/sc-filemover - -%description -scouting daq filemover - -%prep -cp -R $BASEDIR/scripts SOURCES/ - -%install -cd \$RPM_BUILD_ROOT -echo "Creating directories" -mkdir -p opt/sc-filemover -mkdir -p etc/sc-filemover -mkdir -p etc/logrotate.d -mkdir -p usr/lib/systemd/system -mkdir -p etc/init.d -cp $BASEDIR/init.d/sc-filemover.service usr/lib/systemd/system/sc-filemover.service -cp -R $BASEDIR/scripts opt/sc-filemover - -%preun -if [ \$1 == 0 ]; then - /usr/bin/systemctl stop sc-filemover || true - /usr/bin/systemctl disable sc-filemover || true - /usr/bin/systemctl stop sc-filemover || true - /usr/bin/systemctl disable sc-filemover || true -fi - -%files -%defattr(-, root, root, -) -/opt/sc-filemover/ -%attr( 644 ,root, root) /usr/lib/systemd/system/sc-filemover.service - -EOF -mkdir -p RPMBUILDFILEMOVER/{RPMS/{noarch},SPECS,BUILD,SOURCES,SRPMS} -rpmbuild --define "_topdir $(pwd)/RPMBUILDFILEMOVER" -bb sc-filemover.spec - cd /tmp/$PACKAGENAME-build-tmp TOPDIR=$PWD echo "working in $PWD"