As a workaround it is possible to rename the original
proadsv script file:
$DLC/bin/proadsvto
$DLC/bin/PSCproadsvand use a custom
$DLC/bin/proadsv containing lines like:
#!/bin/bash
if [ "$1" = "-start" ]
then echo 'starting adminserver'
if [ "$1" != "" ];
then echo "ARG1="$1 > /usr/117/wrk/arguments.txt
fi
if [ "$2" != "" ];
then echo "ARG2="$2 >> /usr/117/wrk/arguments.txt
fi
if [ "$3" != "" ];
then echo "ARG3="$3 >> /usr/117/wrk/arguments.txt
fi
if [ "$4" != "" ];
then echo "ARG4="$4 >> /usr/117/wrk/arguments.txt
fi
if [ "$5" != "" ];
then echo "ARG5="$5 >> /usr/117/wrk/arguments.txt
fi
if [ "$6" != "" ];
then echo "ARG6="$6 >> /usr/117/wrk/arguments.txt
fi
if [ "$7" != "" ];
then echo "ARG7="$7 >> /usr/117/wrk/arguments.txt
fi
if [ "$8" != "" ];
then echo "ARG8="$8 >> /usr/117/wrk/arguments.txt
fi
/usr/bin/systemctl start openedge
elif
[ "$1" = "-stop" ];
then echo 'stopping adminserver'
if [ "$1" != "" ];
then echo "ARG1="$1 > /usr/117/wrk/arguments.txt
fi
if [ "$2" != "" ];
then echo "ARG2="$2 >> /usr/117/wrk/arguments.txt
fi
if [ "$3" != "" ];
then echo "ARG3="$3 >> /usr/117/wrk/arguments.txt
fi
if [ "$4" != "" ];
then echo "ARG4="$4 >> /usr/117/wrk/arguments.txt
fi
if [ "$5" != "" ];
then echo "ARG5="$5 >> /usr/117/wrk/arguments.txt
fi
if [ "$6" != "" ];
then echo "ARG6="$6 >> /usr/117/wrk/arguments.txt
fi
if [ "$7" != "" ];
then echo "ARG7="$7 >> /usr/117/wrk/arguments.txt
fi
if [ "$8" != "" ];
then echo "ARG8="$8 >> /usr/117/wrk/arguments.txt
fi
/usr/bin/systemctl stop openedge
elif
[ "$1" = "-query" ];
then echo 'querying adminserver'
/usr/117/dlc/bin/PSCproadsv -query "$@"
elif
[ "$1" = "-help" ];
then echo 'adminserver help'
/usr/117/dlc/bin/PSCproadsv -help
elif
[ "$1" = "-status" ];
then echo '--> status of the openedge systemctl service'
/usr/bin/systemctl status openedge
elif
[ "$1" = "" ];
then echo 'no arguments were given to this custom proadsv command'
#/usr/dlc/bin/PSCproadsv
fi
which redirect the '
proadsv -start' and '
proadsv -stop' commands to the '
/usr/bin/systemctl start openedge' and '
/usr/bin/systemctl stop openedge' commands.
The '
/usr/bin/systemctl start openedge' and '
/usr/bin/systemctl stop openedge' commands are then executed against the unmodified
$DLC/bin/PSCproadsv script.
The content of the file
/etc/systemd/system/openedge.service would then be like:
[Unit]
Description=Start/Stop Openedge adminserver
After=syslog.target network.target
[Service]
Type=forking
User=root
Group=root
Environment=TERM=xterm
EnvironmentFile=/usr/117/wrk/arguments.txt
#WorkingDirectory=/tmp
KillMode=none
SendSIGKILL=no
RemainAfterExit=yes
ExecStart=/usr/117/dlc/bin/PSCproadsv $ARG1 $ARG2 $ARG3 $ARG4 $ARG5 $ARG6 $ARG7 $ARG8
ExecStop=/usr/117/dlc/bin/PSCproadsv $ARG1 $ARG2 $ARG3 $ARG4 $ARG5 $ARG6 $ARG7 $ARG8
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=30
[Install]
WantedBy=multi-user.target
Since that
/etc/systemd/system/openedge.service requires arguments from a file like
/usr/117/wrk/arguments.txt that would not be generated or possibly contain wrong information this
openedge systemd service cannot be started or stopped automatically at boot or shutdown of the Linux machine.
Therefore instead of directly starting this
/etc/systemd/system/openedge.service systemd service another systemd service called for example
/etc/systemd/system/oeMachineStartStop.service containing lines like this will need to be created:
[Unit]
Description=Start/Stop the openedge service at Linux machine startup or shutdown
After=syslog.target network.target
[Service]
Type=forking
User=root
Group=root
Environment=TERM=xterm
KillMode=none
SendSIGKILL=no
RemainAfterExit=yes
ExecStart=/usr/117/dlc/bin/proadsv -start
ExecStop=/usr/117/dlc/bin/proadsv -stop
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=30
[Install]
WantedBy=multi-user.target
and then make that service start/stop with the Linux machine using (as root) the command:
systemctl enable oeMachineStartStopif an existing
/etc/systemd/system/openedge.service systemd service that automatically start with the Linux machine already exist then make sure that systemd service do not start directly by itself anymore using the command:
systemctl disable openedgeAlso make sure the file
/usr/wrk/arguments.txt used to pass the arguments to the systemd openedge service have the correct file permissions by doing a:
chmod 666 /usr/wrk/arguments.txtotherwise (not all) Linux users will be able to pass arguments using the custom proadsv command. (and therefore fail to execute the custom proadsv commands)
Example files
$DLC/bin/proadsv,
/etc/systemd/system/openedge.service and
/etc/systemd/system/oeMachineStartStop.service are attached to this supportLink case.
Please note that in those files the
$DLC directory used is
/usr/117/dlc and the
$WRKDIR directory used is
/usr/117/dlc make sure to edit those files to use the correct location for those directories.
Also make sure to do a
mv $DLC/bin/proadsv $DLC/bin/PSCproadsvso that the
/etc/systemd/system/openedge.service file can find the needed original unmodified
proadsv script called
PSCproadsvand give execute permissions to the new files created, for example with the commands:
chmod 777 $DLC/bin/proadsvchmod 777 /etc/systemd/system/openedge.servicechmod 777 /etc/systemd/system/oeMachineStartStop.service