Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Disabling services via systemctl

  1. #1

    Default Disabling services via systemctl

    I'm trying to strip away unnecessary services from running on my openSuse 12.3 system, but have found it difficult to really kill them dead. I've read through Chapter 8 - Systemd in the documentation, but there are problems that I can't quite figure out.

    I'm trying to stop rcpbind and ldap from automatically starting up in my default multi-user mode (runlevel5). I have executed
    "systemctl disable ldap.service" and "systemctl disable rpcbind.service", but they still launch on a reboot. I verified that the system took my commands:
    pabst:~ # systemctl status ldap.service
    ldap.service - LSB: OpenLDAP Server (slapd)
    Loaded: loaded (/etc/init.d/ldap)
    Active: active (running) since Tue, 2013-07-30 04:06:06 EDT; 4h 54min ago
    Process: 624 ExecStart=/etc/init.d/ldap start (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/ldap.service
    â 787 /usr/lib/openldap/slapd -h ldap:/// -f /etc/openldap/slapd.conf -u ldap -g ldap -o slp=o...

    Jul 30 04:06:05 pabst.beer slapd[787]: bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
    Jul 30 04:06:05 pabst.beer slapd[787]: slapd starting
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 fd=13 ACCEPT from IP=127.0.0.1:58969 (IP=0.0.0.0:389)
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=0 BIND dn="" method=128
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=0 RESULT tag=97 err=0 text=
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=1 SRCH base="" scope=0 deref=0 filter="(objectClass=*)"
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=2 UNBIND
    Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 fd=13 closed
    Jul 30 04:06:06 pabst.beer systemd[1]: Started LSB: OpenLDAP Server (slapd).


    pabst:~ # systemctl status rpcbind.service
    rpcbind.service - RPC Bind
    Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; disabled)
    Active: active (running) since Tue, 2013-07-30 04:05:58 EDT; 4h 55min ago
    Main PID: 503 (rpcbind)
    CGroup: name=systemd:/system/rpcbind.service
    â 503 /sbin/rpcbind -w -f

    Jul 30 04:05:58 pabst.beer systemd[1]: Starting RPC Bind...
    Jul 30 04:05:58 pabst.beer systemd[1]: Started RPC Bind.

    I also noticed that ypbind.service seems to be trying to start, as well, but isn't successful only because of a fatal error.

    pabst:/usr/lib/systemd/system # systemctl status ypbind.service
    ypbind.service - NIS/YP (Network Information Service) Clients to NIS Domain Binder
    Loaded: loaded (/usr/lib/systemd/system/ypbind.service; disabled)
    Active: failed (Result: exit-code) since Tue, 2013-07-30 04:06:03 EDT; 5h 41min ago
    Process: 710 ExecStopPost=/bin/sh -c /bin/rm -f /var/yp/binding/* /var/run/ypbind.pid (code=exited, status=0/SUCCESS)
    Process: 632 ExecStartPost=/usr/share/ypbind/ypbind-systemd-post (code=exited, status=0/SUCCESS)
    Process: 631 ExecStart=/bin/sh -c /usr/share/ypbind/ypbind-systemd-pre; exec /usr/sbin/ypbind -n $OTHER_YPBIND_OPTS (code=exited, status=1/FAILURE)
    CGroup: name=systemd:/system/ypbind.service

    Jul 30 04:06:01 pabst.beer systemd[1]: Started NIS/YP (Network Information Service) Clients to NIS Domain Binder.
    Jul 30 04:06:01 pabst.beer sh[631]: \nError: NIS domain not specified.\n
    Jul 30 04:06:02 pabst.beer sh[631]: domainname not set - aborting.
    Jul 30 04:06:02 pabst.beer systemd[1]: ypbind.service: main process exited, code=exited, status=1/FAILURE
    Jul 30 04:06:03 pabst.beer systemd[1]: Unit ypbind.service entered failed state

    chkconfig shows them as off also, if it matters. (chkconfig is depreciated?)

    Any help in tracking down what is launching these, where I am missing it, and how to successfully stop them would be greatly appreciated. Thank you in advance.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    15,607

    Default Re: Disabling services via systemctl

    Please use CODE tags around your computer texts. It is the button in the tool bar of the post editor. The result will be better for our eyes
    Henk van Velden

  3. #3

    Default Re: Disabling services via systemctl

    [post updated with code tags as suggested.]

    I'm trying to strip away unnecessary services from running on my openSuse 12.3 system, but have found it difficult to really kill them dead. I've read through Chapter 8 - Systemd in the documentation, but there are problems that I can't quite figure out.

    I'm trying to stop rcpbind and ldap from automatically starting up in my default multi-user mode (runlevel5). I have executed
    "systemctl disable ldap.service" and "systemctl disable rpcbind.service", but they still launch on a reboot. I verified that the system took my commands:
    Code:
    pabst:~ # systemctl status ldap.service ldap.service - LSB: OpenLDAP Server (slapd) Loaded: loaded (/etc/init.d/ldap) Active: active (running) since Tue, 2013-07-30 04:06:06 EDT; 4h 54min ago Process: 624 ExecStart=/etc/init.d/ldap start (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/ldap.service â 787 /usr/lib/openldap/slapd -h ldap:/// -f /etc/openldap/slapd.conf -u ldap -g ldap -o slp=o... Jul 30 04:06:05 pabst.beer slapd[787]: bdb_monitor_db_open: monitoring disabled; configure monitor database to enable Jul 30 04:06:05 pabst.beer slapd[787]: slapd starting Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 fd=13 ACCEPT from IP=127.0.0.1:58969 (IP=0.0.0.0:389) Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=0 BIND dn="" method=128 Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=0 RESULT tag=97 err=0 text= Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=1 SRCH base="" scope=0 deref=0 filter="(objectClass=*)" Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text= Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 op=2 UNBIND Jul 30 04:06:06 pabst.beer slapd[787]: conn=1000 fd=13 closed Jul 30 04:06:06 pabst.beer systemd[1]: Started LSB: OpenLDAP Server (slapd). pabst:~ # systemctl status rpcbind.service rpcbind.service - RPC Bind Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; disabled) Active: active (running) since Tue, 2013-07-30 04:05:58 EDT; 4h 55min ago Main PID: 503 (rpcbind) CGroup: name=systemd:/system/rpcbind.service â 503 /sbin/rpcbind -w -f Jul 30 04:05:58 pabst.beer systemd[1]: Starting RPC Bind... Jul 30 04:05:58 pabst.beer systemd[1]: Started RPC Bind.
    I also noticed that ypbind.service seems to be trying to start, as well, but isn't successful only because of a fatal error.
    Code:
    pabst:/usr/lib/systemd/system # systemctl status ypbind.service ypbind.service - NIS/YP (Network Information Service) Clients to NIS Domain Binder Loaded: loaded (/usr/lib/systemd/system/ypbind.service; disabled) Active: failed (Result: exit-code) since Tue, 2013-07-30 04:06:03 EDT; 5h 41min ago Process: 710 ExecStopPost=/bin/sh -c /bin/rm -f /var/yp/binding/* /var/run/ypbind.pid (code=exited, status=0/SUCCESS) Process: 632 ExecStartPost=/usr/share/ypbind/ypbind-systemd-post (code=exited, status=0/SUCCESS) Process: 631 ExecStart=/bin/sh -c /usr/share/ypbind/ypbind-systemd-pre; exec /usr/sbin/ypbind -n $OTHER_YPBIND_OPTS (code=exited, status=1/FAILURE) CGroup: name=systemd:/system/ypbind.service Jul 30 04:06:01 pabst.beer systemd[1]: Started NIS/YP (Network Information Service) Clients to NIS Domain Binder. Jul 30 04:06:01 pabst.beer sh[631]: \nError: NIS domain not specified.\n Jul 30 04:06:02 pabst.beer sh[631]: domainname not set - aborting. Jul 30 04:06:02 pabst.beer systemd[1]: ypbind.service: main process exited, code=exited, status=1/FAILURE Jul 30 04:06:03 pabst.beer systemd[1]: Unit ypbind.service entered failed state
    chkconfig shows them as off also, if it matters. (chkconfig is depreciated?)

    Any help in tracking down what is launching these, where I am missing it, and how to successfully stop them would be greatly appreciated. Thank you in advance.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    15,607

    Default Re: Disabling services via systemctl

    Sorry, I didn't mean to le yuouy post everything again. It was meant for future posts. But in any case you got the trick <9except for the superfluous white space in front of all lines, no, please do not post for the third time ).

    I have no doubt someone will offer you the correct statements, I am still not fluent with systemd . But I also undrstand that the old sysvinit statements still work.
    Henk van Velden

  5. #5

    Default Re: Disabling services via systemctl

    Apparently some other service depends on them, and therefore they get started despite being disabled.

    You could try to mask them:
    Code:
    systemctl mask ldap.service
    From "man systemctl":
    Code:
           mask [NAME...]
               Mask one or more unit files, as specified on the command line. This
               will link these units to /dev/null, making it impossible to start
               them. This is a stronger version of disable, since it prohibits all
               kinds of activation of the unit, including manual activation. Use
               this option with care.
    
           unmask [NAME...]
               Unmask one or more unit files, as specified on the command line.
               This will undo the effect of mask.
    Or just uninstall the corresponding packages.
    openldap2 is not installed by default anyway.
    ypbind is, but it doesn't start on my system:
    Code:
    wolfi@amiga:~> systemctl status ypbind.service
    ypbind.service - NIS/YP (Network Information Service) Clients to NIS Domain Binder
              Loaded: loaded (/usr/lib/systemd/system/ypbind.service; disabled)
              Active: inactive (dead)
              CGroup: name=systemd:/system/ypbind.service
    
    wolfi@amiga:~>
    You can list out the dependencies by:
    Code:
    systemctl dot|grep ypbind

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    21,592

    Default Re: Disabling services via systemctl

    On 2013-07-30 17:16, gergan wrote:

    > I'm trying to stop rcpbind and ldap from automatically starting up in
    > my default multi-user mode (runlevel5).


    How do you know that they are not needed?

    Or in other words: why did you install ldap? It is not installed by
    default. If the system installed it is because you made certain choices
    that need it.

    Likewise, rcpbind is used by other services, like nfs. It is not started
    independently.

    Which is the reason you can not stop them.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    21,592

    Default Re: Disabling services via systemctl

    On 2013-07-30 18:26, wolfi323 wrote:
    >
    > Apparently some other service depends on them, and therefore they get
    > started despite being disabled.
    >
    > You could try to mask them:


    But that may break the system, as other service is using them.
    >
    >
    > You can list out the dependencies by:
    >
    > Code:
    > --------------------
    > systemctl dot|grep ypbind
    > --------------------


    Interesting. The command suggests this:

    Code:
    -- You probably want to process this output with graphviz' dot tool.
    -- Try a shell pipeline like 'systemctl dot | dot -Tsvg > systemd.svg'!
    which takes a long time. I then used "display" to display the resulting
    graph, and this almost killed my system because it wanted 6.8 GB of RAM!


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    3,115

    Default Re: Disabling services via systemctl

    Although probably not the recommended way, I would start with finding all Units with the particular name.

    So for instance if I run the following command
    Code:
    systemctl -a | grep rpcbind
    You will see that there is not only a service but a target unit.
    Target units are run as part of the boot sequence while the service units usually start later.
    Note also that I used the "-a" flag to display "all" units, not just loaded.

    I haven't thought about trying to identify the parents of a particular Unit, but if "status" identifies a CGroup the Unit belongs to, I suspect that would be a good clue to the name of the Parent.

    HTH,
    TSU

  9. #9

    Default Re: Disabling services via systemctl

    Quote Originally Posted by robin_listas View Post
    On 2013-07-30 18:26, wolfi323 wrote:
    >
    > Apparently some other service depends on them, and therefore they get
    > started despite being disabled.
    >
    > You could try to mask them:


    But that may break the system, as other service is using them.
    Possibly. That's why I posted the help text for "unmask" as well.

    >
    >
    > You can list out the dependencies by:
    >
    > Code:
    > --------------------
    > systemctl dot|grep ypbind
    > --------------------


    Interesting. The command suggests this:

    Code:
    -- You probably want to process this output with graphviz' dot tool.
    -- Try a shell pipeline like 'systemctl dot | dot -Tsvg > systemd.svg'!
    which takes a long time. I then used "display" to display the resulting
    graph, and this almost killed my system because it wanted 6.8 GB of RAM!
    Firefox displays the graph just fine on my system. Didn't want to try "display" now because I only have 2GB RAM and 2GB swap.
    But the text output should be enough to find out what needs those services.

  10. #10

    Default Re: Disabling services via systemctl

    Quote Originally Posted by gergan View Post
    I I have executed
    "systemctl disable ldap.service" and "systemctl disable rpcbind.service", but they still launch on a reboot.
    Loaded: loaded (/etc/init.d/ldap)



    This is normal sysvinit script, you need to use chkconfig to disable it.

    Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; disabled)

    rpcbind is socket-activated. You need to disable rpcbind.socket.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •