How to start a service app ?

Steve Langasek steve.langasek at canonical.com
Fri Apr 3 19:42:08 UTC 2015


On Thu, Apr 02, 2015 at 09:13:17AM -0500, Jamie Strandboge wrote:
> Snappy uses systemd so stopping and starting services needs to use
> systemctl.  Eg:

> $ systemctl list-units --no-pager | grep webdm  webdm_avahi_0.1.service
>                                                          loaded active running
>  Avahi daemon
>   webdm_snappyd_0.1.service
>            loaded active running   Snappy WebDM
> 
> $ systemctl status webdm_snappyd_0.1.service
> 
> $ sudo systemctl stop webdm_snappyd_0.1.service   # needs sudo
> 
> $ sudo systemctl start webdm_snappyd_0.1.service  # needs sudo

For the record, the 'service' command is compatible with systemd; you just
have to know the name of the service you're trying to start.

# service webdm_avahi_0.1 status
● webdm_avahi_0.1.service - Avahi daemon
   Loaded: loaded (/etc/systemd/system/webdm_avahi_0.1.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2015-04-03 19:38:01 UTC; 1min 37s ago
 Main PID: 1113 (avahi-daemon)
   CGroup: /system.slice/webdm_avahi_0.1.service
           └─1113 avahi-daemon: running [webdm.local]

Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Failed to read /etc...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Joining mDNS multic...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: New relevant interf...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Joining mDNS multic...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: New relevant interf...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Network interface e...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Registering new add...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Registering new add...
Apr 03 19:38:01 localhost.localdomain avahi-daemon[1113]: Registering HINFO r...
Apr 03 19:38:02 localhost.localdomain avahi-daemon[1113]: Server startup comp...
Hint: Some lines were ellipsized, use -l to show in full.
#

Since 'service --status-all' does not list systemd units, the discovery of
the service name is the hard part, and for that systemctl is the best tool.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150403/5c749704/attachment.pgp>


More information about the snappy-devel mailing list