8

I am absolute not into Linux system administration (I am a software developer) and I have the following question for you about services.

On an Ubuntu 18.04.2 LTS machine there is installed a software as service. I mean that I can run it performing this statment in the shell:

sudo service wso2ei start

and I have the service configuration file into:

/etc/systemd/system/wso2ei.service

that contains something like this:

[Unit]
Description=WSO2EI

After=syslog.target
After=network.target

[Service]
Type=simple
WorkingDirectory=/usr/lib/wso2/wso2ei/6.4.0
User=root
Group=nogroup
Environment=JAVA_HOME=/usr/lib/wso2/wso2ei/6.4.0/jdk/jdk1.8.0_192
Environment=CARBON_HOME=/usr/lib/wso2/wso2ei/6.4.0

StandardOutput=syslog
StandardError=syslog

ExecStart=/usr/lib/wso2/wso2ei/6.4.0/bin/integrator.sh
ExecStop=/usr/lib/wso2/wso2ei/6.4.0/integrator.sh stop

#TimeoutSec=130

[Install]
WantedBy=multi-user.target

it is working fine and I can start and stop the service by the following statments:

sudo service wso2ei start

and

sudo service wso2ei stopt

So this service is working fine...but...I tried to list all the services by this stament:

service --status-all

I expected to find my wso2ei service into the output list but there isn't !!!

This is my output:

$ sudo service --status-all
 [ - ]  acpid
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  atd
 [ + ]  cntlm
 [ - ]  console-setup.sh
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  dbus
 [ + ]  ebtables
 [ + ]  grub-common
 [ - ]  hwclock.sh
 [ + ]  irqbalance
 [ + ]  iscsid
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ - ]  lvm2
 [ + ]  lvm2-lvmetad
 [ + ]  lvm2-lvmpolld
 [ + ]  lxcfs
 [ - ]  lxd
 [ - ]  mdadm
 [ - ]  mdadm-waitidle
 [ - ]  ntp
 [ - ]  open-iscsi
 [ - ]  open-vm-tools
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  procps
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  screen-cleanup
 [ + ]  ssh
 [ + ]  udev
 [ - ]  ufw
 [ + ]  unattended-upgrades
 [ - ]  uuidd
$

Why my wso2ei is not in this list? What is wrong? What am I missing?

Moreover: if I check the status of this particular service I obtain this output:

$ sudo service wso2ei status
● wso2ei.service - WSO2EI
   Loaded: loaded (/etc/systemd/system/wso2ei.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-10-11 21:03:06 CEST; 1 day 22h ago
  Process: 56854 ExecStop=/usr/lib/wso2/wso2ei/6.4.0/integrator.sh stop (code=exited, status=203/EXEC)
 Main PID: 56912 (integrator.sh)
    Tasks: 179 (limit: 9486)
   CGroup: /system.slice/wso2ei.service
           ├─56912 /bin/sh /usr/lib/wso2/wso2ei/6.4.0/bin/integrator.sh
           └─56958 /usr/lib/wso2/wso2ei/6.4.0/jdk/jdk1.8.0_192/bin/java -Xbootclasspath/a: -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -X

So I think that the service statment find the wso2ei service in some way.

I think that I am missing something...

14

According to the manpage

service --status-all

shows

service --status-all runs all init scripts, in alphabetical order,
with the status command. The status is [ + ] for running services,
[ - ] for stopped services and [ ? ] for services without a
status command.  This option only calls  status for sysvinit jobs.
ls -al /etc/init.d/

There can you see the listed services from sysvinit system.

You wrote an systemd unit, they can be listed with:

systemctl list-units     # for currently active units
systemctl -a list-units  # for all known units

Add the --user flag to these commands if you want to list the current user’s units instead of the system ones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.