Skip to Main Content
Right Side Region Collapsed Set an Attribute to read only or hidden

Run ORDS as a systemd Service

Run ORDS as a systemd Service

 

Commands:

#
systemctl daemon-reload

# To enable and start the service use
systemctl enable ords
systemctl start ords
systemctl stop ords

# You can follow the ORDS log with journalctl:
journalctl -f -u ords.service

# To check the status or stop the service use:
systemctl restart ords
systemctl status ords -l

 

File name: /etc/systemd/system/ords.service

[Unit]
Description=Oracle REST Data Services (ORDS)
After=network-online.target remote-fs.target
Wants=network-online.target

[Service]
Type=simple
User=root
Group=dba

Environment=ORDS_HOME=/u00/oracle/product/ords
Environment=ORDS_CONFIG=/etc/ords/config
Environment=LOGFILE=/var/log/ords/ords.log

RuntimeDirectory=ords
RuntimeDirectoryMode=0755
PIDFile=/var/run/ords/ords.pid

# Start ORDS in foreground so systemd can supervise it
ExecStart=/bin/bash -lc '${ORDS_HOME}/bin/ords --config ${ORDS_CONFIG} serve'

# Optional: write PIDFile via ExecStartPost (only if you truly need a pidfile)
ExecStartPost=/bin/bash -lc 'echo $MAINPID > /run/ords/ords.pid'

ExecStop=/bin/kill -TERM $MAINPID
TimeoutStopSec=30
KillMode=control-group
SuccessExitStatus=143

Restart=on-failure
RestartSec=60

StandardOutput=append:/var/log/ords/ords.log
StandardError=append:/var/log/ords/ords.log

[Install]
WantedBy=multi-user.target