Bug 4763 - cannot stop cups.service (with service, systemd, killall -9 etc...)
Summary: cannot stop cups.service (with service, systemd, killall -9 etc...)
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: D Morgan
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 2120
  Show dependency treegraph
 
Reported: 2012-03-01 16:08 CET by Chris Denice
Modified: 2012-03-24 22:38 CET (History)
2 users (show)

See Also:
Source RPM: cups-1.5.2-1.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Chris Denice 2012-03-01 16:08:17 CET
Description of problem:

I would like to stop cups systemd service, but it looks impossible as it respawns (like in Doom game nightmare mode) all the time:

systemctl stop cups service

systemctl status cups service
Active: active (running) since Thu, 01 Mar 2012 16:00:23 +0100; 5s ago

sytemctl kill cups service
active (running) since Thu, 01 Mar 2012 16:05:34 +0100; 176ms ago

killall -9 cupsd
systemctl status cups service
Active: active (running) since Thu, 01 Mar 2012 16:06:08 +0100; 1s ago

AHHHHHHH

How reproducible:

on my computer all the time :(
Comment 1 Bit Twister 2012-03-01 18:05:35 CET
Hmm, works for me. But then again I use a period between cups.service
and I have smb.service disabled because it complained about cusps not running.


[root@wb2 ~]# systemctl enable cups.service
ln -s '/lib/systemd/system/cups.service' '/etc/systemd/system/printer.target.wants/cups.service'
ln -s '/lib/systemd/system/cups.socket' '/etc/systemd/system/sockets.target.wants/cups.socket'
ln -s '/lib/systemd/system/cups.path' '/etc/systemd/system/multi-user.target.wants/cups.path'

[root@wb2 ~]# systemctl start cups.service

[root@wb2 ~]# systemctl status cups.service
cups.service - CUPS Printing Service
          Loaded: loaded (/lib/systemd/system/cups.service; enabled)
          Active: active (running) since Thu, 01 Mar 2012 11:00:55 -0600; 4s ago
        Main PID: 3639 (cupsd)
          CGroup: name=systemd:/system/cups.service
                  â 3639 /usr/sbin/cupsd -f

[root@wb2 ~]# systemctl stop cups.service

[root@wb2 ~]# systemctl status cups.service
cups.service - CUPS Printing Service
          Loaded: loaded (/lib/systemd/system/cups.service; enabled)
          Active: inactive (dead) since Thu, 01 Mar 2012 11:01:06 -0600; 3s ago
         Process: 3639 ExecStart=/usr/sbin/cupsd -f (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/cups.service

[root@wb2 ~]# systemctl disable cups.service
rm '/etc/systemd/system/printer.target.wants/cups.service'
rm '/etc/systemd/system/sockets.target.wants/cups.socket'
rm '/etc/systemd/system/multi-user.target.wants/cups.path'

CC: (none) => junk_no_spam

Manuel Hiebel 2012-03-01 23:59:00 CET

Blocks: (none) => 2120
Assignee: bugsquad => dmorganec

Comment 2 Colin Guthrie 2012-03-24 22:38:48 CET
Cups the service will stop fine, but if something wants to use cups it will be started again via socket activation.

e.g. see the following sequence:


[root@jimmy ~]# systemctl status cups.service
cups.service - CUPS Printing Service
	  Loaded: loaded (/lib/systemd/system/cups.service; enabled)
	  Active: active (running) since Sat, 24 Mar 2012 21:32:34 +0000; 21s ago
	Main PID: 11522 (cupsd)
	  CGroup: name=systemd:/system/cups.service
		  â 11522 /usr/sbin/cupsd -f

[root@jimmy ~]# ps aux | grep cups
root     11522  0.0  0.1 100644  3848 ?        Ss   21:32   0:00 /usr/sbin/cupsd -f

So we start off with cups running. All is well in the world, but lets stop it.

[root@jimmy ~]# systemctl stop cups.service
[root@jimmy ~]# ps aux | grep cups
[root@jimmy ~]# systemctl status cups.service
cups.service - CUPS Printing Service
	  Loaded: loaded (/lib/systemd/system/cups.service; enabled)
	  Active: inactive (dead) since Sat, 24 Mar 2012 21:33:08 +0000; 7s ago
	 Process: 11522 ExecStart=/usr/sbin/cupsd -f (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/cups.service


OK, so cups is stopped. Again all is well in the world. But what happens when we try to make use of a command that needs to use cups:

[root@jimmy ~]# lpq
lpq: Error - no default destination available.

OK, so what is the state of things now?

[root@jimmy ~]# systemctl status cups.service
cups.service - CUPS Printing Service
	  Loaded: loaded (/lib/systemd/system/cups.service; enabled)
	  Active: active (running) since Sat, 24 Mar 2012 21:33:22 +0000; 2s ago
	Main PID: 11566 (cupsd)
	  CGroup: name=systemd:/system/cups.service
		  â 11566 /usr/sbin/cupsd -f

[root@jimmy ~]# ps aux | grep cups
root     11566  0.1  0.1 100644  3844 ?        Ss   21:33   0:00 /usr/sbin/cupsd -f


OK, so just running lpq has automatically spawned cups! Yay for functionality!!

So all this is expected behaviour.

If you really don't want it, simply do:

[root@jimmy ~]# systemctl stop cups.service cups.socket
[root@jimmy ~]# ps aux | grep cups
[root@jimmy ~]# lpq
lpq: Unable to connect to server.
[root@jimmy ~]# ps aux | grep cups

So as you can see, cups is no longer spawned automatically.

To reenable autospawning (without starting cups itself) simply do:
[root@jimmy ~]# systemctl start cups.socket
[root@jimmy ~]# lpq
lpq: Error - no default destination available.
[root@jimmy ~]# ps aux | grep cups
root     11643  0.2  0.1 100644  3844 ?        Ss   21:37   0:00 /usr/sbin/cupsd -f



So as you can see, this is simply a feature, not a bug.

Status: NEW => RESOLVED
CC: (none) => mageia
Resolution: (none) => INVALID


Note You need to log in before you can comment on or make changes to this bug.