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

Re: Disable systemd script just by removing execute permission?



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?

If it doesn't work out, you could insert "exit 0" right under the shebang,
and restore the execute perms.  That's the normal way one tells a shell
script to do nothing, and stop complaining about it.


Reply to: