Commit fe41a711 authored by Ramon Nou's avatar Ramon Nou
Browse files

Solved some issues with systemd

parent 2676e81d
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@ if [ "$1" == "start" ]; then
    datadir=$7
    mountdir=$9
    unset SLURM_CPU_BIND SLURM_CPU_BIND_LIST SLURM_CPU_BIND_TYPE SLURM_CPU_BIND_VERBOSE
    srun -N $num_nodes -n $num_nodes --oversubscribe --cpus-per-task=1 --mem-per-cpu=1 --export=ALL bash -c "mkdir -p $mountdir; mkdir -p $datadir" 
    srun -N $num_nodes -n $num_nodes --oversubscribe --cpus-per-task=4 --mem-per-cpu=1 --export=ALL bash -c "gkfs_daemon --rootdir $datadir --mountdir $mountdir" &
    srun -N $num_nodes -n $num_nodes --oversubscribe --overlap --cpus-per-task=1 --mem-per-cpu=1 --export=ALL bash -c "mkdir -p $mountdir; mkdir -p $datadir" 
    srun -N $num_nodes -n $num_nodes --oversubscribe --overlap --cpus-per-task=4 --mem-per-cpu=1 --export=ALL bash -c "gkfs_daemon --rootdir $datadir --mountdir $mountdir" &
    sleep 4
elif [ "$1" == "stop" ]; then
    echo "Stopping GEKKOFS"
@@ -28,7 +28,7 @@ elif [ "$1" == "stop" ]; then
        exit 0
    fi
    unset SLURM_CPU_BIND SLURM_CPU_BIND_LIST SLURM_CPU_BIND_TYPE SLURM_CPU_BIND_VERBOSE
    srun -N $num_nodes -n $num_nodes --oversubscribe --cpus-per-task=1 --mem-per-cpu=1 pkill -9 gkfs_daemon
    srun -N $num_nodes -n $num_nodes --overlap --oversubscribe --cpus-per-task=1 --mem-per-cpu=1 --export=ALL bash -c "pkill -9 gkfs_daemon"
elif [ "$1" == "expand" ]; then
    echo "Expand command"
elif [ "$1" == "shrink" ]; then
+2 −2
Original line number Diff line number Diff line
@@ -108,8 +108,8 @@ CARGO_CONFIG_FILE=$CONFIG_DIRECTORY/$CARGO_ID.cfg
CARGO_SERVICE_NAME=$(systemd-escape --template cargo@.service "$CARGO_ID")

echo "Shutting down Cargo data stager for job $SLURM_JOB_ID (user: $SLURM_JOB_USER)"

if ! run_as "$SLURM_JOB_USER" systemctl --user stop "$CARGO_SERVICE_NAME"; then
CUID=$(id -u $SLURM_JOB_USER)
if ! run_as "$SLURM_JOB_USER" DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$CUID/bus systemctl --user stop "$CARGO_SERVICE_NAME"; then
  exit 1
fi