Appendix F: Auto Start/Stop of Dbvnet and Dbvserver using systemd


When using RHEL 7 or OEL 7 Linux, you may want to enable the use of systemd to automatically start or stop Dbvnet and Dbvserver on system restart.  

This document will provide you with the sample configuration files and commands which you can use to enable this.

For more detail on the use of systemd please refer to the RHEL or OEL documentation.

Dbvnet:

Create a file in /usr/lib/systemd/system called dbvnet.service

Copy the text below to the dbvnet.service file.  You might need to adjust the path where Dbvisit Standby is installed - in the example below /usr/dbvisit is the DBVISIT_BASE location:

# /usr/lib/systemd/system/dbvnet.service
#
# Dbvisit Standby - Dbvnet systemd unit file:
# description: Dbvisit network infrastructure daemon. 

[Unit]
Description=Dbvisit Standby - Dbvnet
After=syslog.target network.target

[Service]
Type=simple
RemainAfterExit=yes
User=oracle
Group=oinstall
ExecStart=/bin/bash -c'/usr/dbvisit/dbvnet/dbvnetd start >> /usr/dbvisit/dbvnet/log/dbvnet-systemd.log 2>&1 &
ExecStop=/bin/bash -c'/usr/dbvisit/dbvnet/dbvnetd stop >> /usr/dbvisit/dbvnet/log/dbvnet-systemd.log 2>&1

[Install]
WantedBy=multi-user.target


 To enable the service:

# systemctl daemon-reload
# systemctl enable dbvnet.service


Then to start and stop you can use:

# systemctl start dbvnet.service
# systemctl stop dbvnet.service

Dbvserver:

Create a file in /usr/lib/systemd/system called dbvserver.service

Copy the text below to the dbvserver.service file.  You might need to adjust the path where Dbvisit Standby is installed - in the example below /usr/dbvisit is the DBVISIT_BASE location:

# /usr/lib/systemd/system/dbvserver.service
#
# Dbvisit Standby - Dbvserver systemd unit file:
# description: Dbvisit webserver daemon. 
#

[Unit]
Description=Dbvisit Standby - Dbvserver
After=syslog.target network.target


[Service]
Type=simple
RemainAfterExit=yes
User=oracle
Group=oinstall
ExecStart=/bin/bash -c'/usr/dbvisit/dbvserver/dbvserverd start >> /usr/dbvisit/dbvserverd/log/dbvserverd-systemd.log 2>&1 &
ExecStop=/bin/bash -c'/usr/dbvisit/dbvserver/dbvserverd stop >> /usr/dbvisit/dbvserverd/log/dbvserverd-systemd.log 2>&1

[Install]
WantedBy=multi-user.target


 To enable the service:

# systemctl daemon-reload
# systemctl enable dbvserver.service


Then to start and stop you can use:

# systemctl start dbvserver.service
# systemctl stop dbvserver.service





It is recommended that you test these steps in your development or test environment prior to implementing in production as some adjustments might be required to meet your environment.