0

I have added a service unit in Ubuntu 16.04:

[Unit]
Description=seaweedfs
After=network.target

[Service]
User=root
ExecStart=/root/work/bin/weed -v=0 volume -mserver=18.21.1.150:9333 -ip=8.9.4.9 -dir=/storage -max=2270 -images.fix.orientation=false -pulseSeconds=1

Everything is working fine. But I want to know if the process has been started or not. Or if it stopped, then I want to see some output as it has been stopped.

Right now am doing service seaweedfs start. It starts but doesn't show any message. I want to add some useful messages to it on start or stop.

Will be thankful for any help :)

Zanna
  • 72,312

1 Answers1

0

You can check sudo netstat -nlutp | grep weed to see if the port assigned in your .service file, (9333 in this case) opened.

If you see like this, the service may started

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 192.168.0.2:8081        0.0.0.0:*               LISTEN      25878/./weed
tcp6       0      0 :::9333                 :::*                    LISTEN      1244/./weed
muru
  • 207,228
Shawn Wang
  • 101
  • 1