[Unit] Description=Juniper vMX Router Wants=network-online.target After=network-online.target After=libvirtd.service [Service] #################################### Set these two settings for your enviroment. Everything below this section should not need to be edited. #################################### ## This path must be set correctly for the vMX to stop/start automatically. ## The working directory should contain the script vmx.sh WorkingDirectory=/home/vMX-18.3R1 ## Important: If you are using CentOS 7 you must uncomment this enviroment variable - the Python version is different than the default. #Environment="PATH=/opt/rh/python27/root/usr/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/dell/srvadmin/bin:/opt/dell/srvadmin/sbin:/opt/dell/srvadmin/iSM/bin:/root/bin" #################################### End of settings to change, no edits need to be made below. #################################### ## Set the service type as oneshot, after the script is executed it will exit and not remain running. Type=oneshot ## Run the script as the root user User=root Group=root ## Since the vMX will continue running after the script executes this is set to true. RemainAfterExit=true ## Commands used to stop/start/restart the vMX ExecStart=/bin/bash -c './vmx.sh -lv --start' ExecStop=/bin/bash -c './vmx.sh --stop' ExecReload=/bin/bash -c './vmx.sh --restart' [Install] WantedBy=multi-user.target