Results 1 to 8 of 8

Thread: How to stop Redshift from starting automatically?

  1. #1

    Default How to stop Redshift from starting automatically?

    Today, I did a fresh install of openSUSE LEAP 15. Things went smoothly for the most part, however, I noticed that two packages are behaving slightly differently than they used to in openSUSE LEAP 42. Namely, 'syncthing' and 'redshift'. Both of these packages are configured by default to auto start with each session. Moreover, every time I kill redshift, it auto re-spawns immediately. Basically, I could not stop redshift from running except by uninstalling it!

    For syncthing, I am okay with that behavior. I usually add an "Autostart" entry for syncthing manually. Now, I don't need to do that. However, for redshift, this is not the desired behavior, and I cannot seem to turn it off.

    Where are the configurations for those behaviors? And, how to disable it for redshift?

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,832
    Blog Entries
    15

    Default Re: How to stop Redshift from starting automatically?

    Quote Originally Posted by zaidgs View Post
    Today, I did a fresh install of openSUSE LEAP 15. Things went smoothly for the most part, however, I noticed that two packages are behaving slightly differently than they used to in openSUSE LEAP 42. Namely, 'syncthing' and 'redshift'. Both of these packages are configured by default to auto start with each session. Moreover, every time I kill redshift, it auto re-spawns immediately. Basically, I could not stop redshift from running except by uninstalling it!

    For syncthing, I am okay with that behavior. I usually add an "Autostart" entry for syncthing manually. Now, I don't need to do that. However, for redshift, this is not the desired behavior, and I cannot seem to turn it off.

    Where are the configurations for those behaviors? And, how to disable it for redshift?
    Hi
    It's a systemd service (two of them), so;
    Code:
    su -
    systemctl status redshift
    systemctl status redshift-gtk
    
    (stop and disable as required)
    systemctl stop redshift
    systemctl stop redshift-gtk
    
    systemctl disable redshift
    
    systemctl disable redshift-gtk
    exit
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: How to stop Redshift from starting automatically?

    Thank you malcolmlewis.

    The exact command you suggested did not work, however, after adding "--user" to the command it seemed to work (at first).

    Code:
    > systemctl status redshift
    Unit redshift.service could not be found.
    
    > systemctl stop redshift --user
    > systemctl disable redshift --user
    > systemctl status redshift --user
    ● redshift.service - Redshift display colour temperature adjustment
       Loaded: loaded (/usr/lib/systemd/user/redshift.service; disabled; vendor preset: enabled)
       Active: inactive (dead) since Sun 2018-05-27 14:35:36 EDT; 3min 46s ago
         Docs: http://jonls.dk/redshift/                      
     Main PID: 2415 (code=exited, status=0/SUCCESS)
    The stop command seems to work correctly. Unforturnately, after a restart the service is running again!

    Code:
    > systemctl status redshift --user
    ● redshift.service - Redshift display colour temperature adjustment
       Loaded: loaded (/usr/lib/systemd/user/redshift.service; disabled; vendor preset: enabled)
       Active: active (running) since Sun 2018-05-27 14:44:10 EDT; 44s ago
         Docs: http://jonls.dk/redshift/
     Main PID: 2005 (redshift)
       CGroup: /user.slice/user-1000.slice/user@1000.service/redshift.service
               └─2005 /usr/bin/redshift
    PS: I have not installed redshift-gtk, nor is the service for it present.

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,832
    Blog Entries
    15

    Default Re: How to stop Redshift from starting automatically?

    Quote Originally Posted by zaidgs View Post
    Thank you malcolmlewis.

    The exact command you suggested did not work, however, after adding "--user" to the command it seemed to work (at first).

    Code:
    > systemctl status redshift
    Unit redshift.service could not be found.
    
    > systemctl stop redshift --user
    > systemctl disable redshift --user
    > systemctl status redshift --user
    ● redshift.service - Redshift display colour temperature adjustment
       Loaded: loaded (/usr/lib/systemd/user/redshift.service; disabled; vendor preset: enabled)
       Active: inactive (dead) since Sun 2018-05-27 14:35:36 EDT; 3min 46s ago
         Docs: http://jonls.dk/redshift/                      
     Main PID: 2415 (code=exited, status=0/SUCCESS)
    The stop command seems to work correctly. Unforturnately, after a restart the service is running again!

    Code:
    > systemctl status redshift --user
    ● redshift.service - Redshift display colour temperature adjustment
       Loaded: loaded (/usr/lib/systemd/user/redshift.service; disabled; vendor preset: enabled)
       Active: active (running) since Sun 2018-05-27 14:44:10 EDT; 44s ago
         Docs: http://jonls.dk/redshift/
     Main PID: 2005 (redshift)
       CGroup: /user.slice/user-1000.slice/user@1000.service/redshift.service
               └─2005 /usr/bin/redshift
    PS: I have not installed redshift-gtk, nor is the service for it present.
    Hi
    Try masking the service;
    Code:
    systemctl mask redshift --user
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: How to stop Redshift from starting automatically?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Try masking the service;
    Code:
    systemctl mask redshift --user
    Thanks again malcolmlewis. Your suggestion did work.

    I tried to investigate this further, and find out which service was causing redshift to start. What I found was a service called 'default.target'.

    Code:
    > systemctl list-dependencies redshift --user --reverse
    redshift.service
    ● └─default.target
    > systemctl list-dependencies default.target --user
    default.target
    ● ├─redshift.service
    ● ├─syncthing.service
    ● └─basic.target
    ●   ├─paths.target
    ●   ├─sockets.target
    ●   │ └─dbus.socket
    ●   └─timers.target
    Could someone explain to me what this mysterious 'default.target' service is?

  6. #6

    Default Re: How to stop Redshift from starting automatically?

    Quote Originally Posted by zaidgs View Post
    Could someone explain to me what this mysterious 'default.target' service is?
    It's the target the system is supposed to boot too, similar to the "default runlevel" in per-systemd times.

    If a service is enabled to be started on boot, it is added to the default.target's dependencies.

    Btw, your problem is a known bug, all user systemd services are enabled by default although they shouldn't be.
    https://bugzilla.opensuse.org/show_bug.cgi?id=1090480
    https://bugzilla.opensuse.org/show_bug.cgi?id=1090785
    (the latter apparently has been fixed meanwhile in Factory, no idea whether an update for SLE/Leap 15.0 is planned or not)

  7. #7

    Default Re: How to stop Redshift from starting automatically?

    Quote Originally Posted by wolfi323 View Post
    It's the target the system is supposed to boot too, similar to the "default runlevel" in per-systemd times.

    If a service is enabled to be started on boot, it is added to the default.target's dependencies
    Thank you, wolfi323. I am trying to get a better understanding of how things are being done under-the-hood. So, if instead of masking the redshift service, I wanted to exclude redshift from being started by the target.default, how do I do that?

    And what is the advantage of using default.target to start a service, instead of simply enabling the service?

  8. #8

    Default Re: How to stop Redshift from starting automatically?

    Quote Originally Posted by zaidgs View Post
    So, if instead of masking the redshift service, I wanted to exclude redshift from being started by the target.default, how do I do that?
    Masking is the way to prevent a service from being started.

    Actually "disable" should work too, but it may still be started if another service wants to have it.

    And what is the advantage of using default.target to start a service, instead of simply enabling the service?
    Difference?
    That's exactly what enabling a service actually does. It adds it to the services to be started by default.target.

Posting Permissions

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