$ sudo service cassandra status
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; bad; vendor preset: enabled)
Active: active (running) since Wed 2016-10-12 15:54:40 IDT; 4min 4s ago
What does the bad;
part on the 2nd line of the output stand for?
I get this for many services, e.g. mysql, winbind, virtualbox, some of which I've flawlessly used already (cassandra being a fresh install).
Short answer:
bad
: It showsSystemd Unit files
enablement statussystemd
you can check the enablement status using command:
if that unit file is a native systemd service then it will give output
enabled
,disabled
, etc. If it is not a native systemd service then it will give report a message like.but with command :
it gives status
bad
. (maybe it is because it is not able to print a complete message or developer decided to printbad
)Long Answer:
what are system unit files ?
Units are the objects that systemd knows how to manage. These are basically a standardized representation of system resources that can be managed by the suite of daemons and manipulated by the provided utilities. It can be used to abstract services, network resources, devices, filesystem mounts, and isolated resource pools. You can read in detail about systemd units here and here
example:
systemctl will check if
apache2
is a native unit or not. If not, then it will asksystemd-sysv-generator
to generate a file in unit format that provides support similar to native units. In the above example, the generated file is kept at/lib/systemd/system/apache2.service.d/apache2-systemd.conf
Note: you can find the generator at
/lib/systemd/system-generators/systemd-sysv-generator
and you can read more about thatMain point:
if we run the command :
you can see if units are native to systemd like
ssh
anddocker
, in the above output it will show onlyenabled
, and for units that are not native likeapache2
but still enabled it gives messages with that rather than printingbad
here because of this condition:Solution:
status
bad
will not create problem (i am not sure it depends) but it will not provide all functionality ofsystemctl
. you can wait for next release of thatpackage
that will natively supportsystemd
. or you can write unit file for your service or any other resource using given references.You can read in detail about systemd , systemctl and units using below References :
Systemctl
Systemd units and Here
Systemd