[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Disable systemd script just by removing execute permission?



On Fri, Jul 01, 2022 at 10:37:17AM +0100, Ottavio Caruso wrote:
> On 30/06/2022 12:09, Greg Wooledge wrote:
> > On Thu, Jun 30, 2022 at 11:30:25AM +0100, Ottavio Caruso wrote:
> > > $ cat  /usr/lib/systemd/system-sleep/tlp
> > > #!/bin/sh
> > > 
> > > # tlp - systemd suspend/resume hook
> > > #
> > > # Copyright (c) 2022 Thomas Koch <linrunner at gmx.net> and others.
> > > # This software is licensed under the GPL v2 or later.
> > > 
> > > case $1 in
> > >      pre)  tlp suspend ;;
> > >      post) tlp resume  ;;
> > > esac
> > > 
> > > I don't want to uninstall tlp altogether, so I have removed execute
> > > permission from this script:
> > > 
> > > $ ls -l /usr/lib/systemd/system-sleep/tlp
> > > -rw-r--r-- 1 root root 239 Feb  3 15:04 /usr/lib/systemd/system-sleep/tlp
> > > 
> > > Is this enough, or do I have to remove it altogether from
> > > /usr/lib/systemd/system-sleep/  ?
> 
> > Try It And See?
> 
> 
> How? I mean, I've noticed that the weirdness have disappeared, but how do  I
> test for sure that the script is not loaded?

Start with "systemctl status whatever".

If that's not enough for you, put something in the script that will leave
a permanent mark (e.g. appending a specific line to a specific file), and
then see if that mark appears.


Reply to: