I'm running OL 7.4.
I'm not an expert of systemd, but I'm trying to get the server to auto start/stop my oracle database.
I've successfully added a systemd service for it. I'm able to start and stop it with systemctl.
On server startup, the service is also started automatically.
My issue is on server shutdown, systemd doesn't seem to stop the service OR... something is else occurs before that crashes the databases (before systemd can gracefully shut it down). I'm used to the old init.d scripts and I simply had to make sure the stop script was first in the order (ie "K01"). I'm new to systemd.
What I have systemd doing is running a shell script to start all the oracle processes I need. And so, once the service "starts", system shows it as "active (exited)."
Code:
[root@duritllora01d ~]# systemctl status dbora
● dbora.service - Oracle Database Services
Loaded: loaded (/usr/lib/systemd/system/dbora.service; enabled; vendor preset: disabled)
Active: active (exited) since Tue 2017-10-10 18:16:40 EDT; 17min ago
Process: 4620 ExecStop=/u11/app/oracle/common/bin/orastop (code=exited, status=0/SUCCESS)
Process: 4887 ExecStart=/u11/app/oracle/common/bin/orastart (code=exited, status=0/SUCCESS)
Main PID: 4887 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/dbora.service
I know enough that when it's a "regular" process, it will show as "running." But since the process is simply the shell script that started the other real processes, once that shell script exits, then its "exited." Is this the reason it is not automatically stopping it during shutdown? It doesn't recognize this as a running service?
The systemd service config file is like this:
Code:
[Unit]
Description=Oracle Database Services
Requires=rpc-statd.service network.target nfs.service nfs-mountd.service local-fs.target remote-fs.target
After=syslog.target network.target nfs.service nfs-mountd.service local-fs.target rpc-statd.service remote-fs.target
[Service]
# systemd ignores PAM limits, so set any necessary limits in the service.
# Not really a bug, but a feature.
# https://bugzilla.redhat.com/show_bug.cgi?id=754285
LimitMEMLOCK=infinity
LimitNOFILE=65535
#Type=simple
# idle: similar to simple, the actual execution of the service binary is delayed
# until all jobs are finished, which avoids mixing the status output with shell output of services.
Type=idle
RemainAfterExit=yes
User=root
ExecStart=/u11/app/oracle/common/bin/orastart
ExecStop=/u11/app/oracle/common/bin/orastop
[Install]
WantedBy=multi-user.target