Article 4TW09 'Active (enabled)' status - what is it, how to avoid it ?

'Active (enabled)' status - what is it, how to avoid it ?

by
Shaggy1
from LinuxQuestions.org on (#4TW09)
Hi
Having just installed 7.7.1908 I notice that the nfs service (also network service and probably others) are marked as Active (enabled) when the status is queried:

systemctl status nfs
i-i nfs-server.service - NFS server and services
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
Active: active (exited) since Wed 2019-11-06 12:34:47 GMT; 1 day 2h ago
Process: 2181 ExecStartPost=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi (code=exited, status=0/SUCCESS)
Process: 1968 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
Process: 1927 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Main PID: 1968 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/nfs-server.service

Nov 06 12:34:47 lb-cam-bca-kstest systemd[1]: Starting NFS server and services...
Nov 06 12:34:47 lb-cam-bca-kstest systemd[1]: Started NFS server and services.

This link:
https://unix.stackexchange.com/quest...ystemd-service
tells me:

"State active (exited) means that systemd has successfully run the commands but that it does not know there is a daemon to monitor.

If there is you must define it in the unit file by configuring the Type and ExecStart options appropriately according to whether the process you start is the main proces, forks child processes and exits etc."

It seems there is already a Unit file for nfs in /usr/lib/systemd/system/nfs.service:

Type and ExecStart are set as follows:
Type=oneshot
ExecStartPre=-/usr/sbin/exportfs -r
ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
ExecStartPost=-/bin/sh -c 'if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi'

Is this status to be expected for nfs on centos 7?

Does anyone know how to get systemd to recognise the nfs service ?

Given systemd does not recognise nfs should I be using a different service to configure nfs ?latest?d=yIl2AUoC8zA latest?i=TlMSTkn8R30:AxNOXy6wzHQ:F7zBnMy latest?i=TlMSTkn8R30:AxNOXy6wzHQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=TlMSTkn8R30:AxNOXy6wzHQ:gIN9vFwTlMSTkn8R30
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments