• Pop!_Planet is still very much under development. Data for the wiki is being sourced from the Arch Linux and Ubuntu wikis, along with a bunch of completely unique content specific to Pop!_OS, and sourcing, converting and updating that content takes time; please be patient. If you can't find what you're looking for here, check the Arch Linux and Ubuntu wikis.

Systemctl --now option

derpOmattic

Pop!_Muse
Trusted User
Founding Member
Nov 23, 2018
178
8
13
www.patreon.com
Having a read in the wiki I came across the the command sudo systemctl enable --now unit, equivalent to sudo systemctl enable unit && sudo systemctl start unit , which is what I've been doing lately. I've also been using && with disable and stop. The wiki didn't mention it, but the man page man systemctl does, the option --now can be used with disable to both stop and disable a service in a more compact command.

If you have a service that you turn on and off regularly you can shorten the command further by creating an alias. Because Bluetooth is a major source of battery drain on my machine I enable and disable Bluetooth often. To change sudo systemctl enable --now bluetooth into alias blu in Terminal, just use the alias command. eg: alias blu='sudo systemctl enable --now bluetooth'. Alternately to disable I use bluo .
 

mmstick

Member
System76 Staff
Founding Member
Dec 15, 2018
64
18
8
25
Denver, Colorado
The bluetooth option in the session menu panel should allow you to quickly toggle between having it activated and deactivated.
 

derpOmattic

Pop!_Muse
Trusted User
Founding Member
Nov 23, 2018
178
8
13
www.patreon.com
The bluetooth option in the session menu panel should allow you to quickly toggle between having it activated and deactivated.
Yes, it does, but it doesn't disable it completely which is what Powetop was suggesting I needed to do. Maybe it's just my machine, but disabling and stopping bluetooth using systemctl stops a lot of power usage, whereas toggling the panel menu deactivates it but is still active and running if checked with systemctl status bluetooth and is using a lot of battery.

I wanted to bring attention to the --now option for use with all services because most often I find disable and stop need to be used together.
 

mmstick

Member
System76 Staff
Founding Member
Dec 15, 2018
64
18
8
25
Denver, Colorado
That's interesting. Sounds like something to investigate.
 

bwat47

New member
Feb 27, 2019
1
0
4
28
I believe going to gnome control center | power tab and disabling bluetooth there disables it completely (via rfkill). Powertop shows that it's disabled for me
 

derpOmattic

Pop!_Muse
Trusted User
Founding Member
Nov 23, 2018
178
8
13
www.patreon.com
Powertop shows that it's disabled for me
What does systemctl status bluetooth output?

I did exactly what you said and disabled from the control center, and Powertop indicates it isn't running but systemctl status bluetooth still outputs;
Code:
 bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset
   Active: active (running) since Wed 2019-03-13 22:08:49 AEST; 7min ago
     Docs: man:bluetoothd(8)
 Main PID: 8936 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 4915)
   Memory: 2.8M
   CGroup: /system.slice/bluetooth.service
           └─8936 /usr/lib/bluetooth/bluetoothd
Yet if I run sudo systemctl disable --now bluetooth, then systemctl status bluetooth outputs;
Code:
bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor prese
   Active: inactive (dead)
     Docs: man:bluetoothd(8)
 
Last edited:

mmstick

Member
System76 Staff
Founding Member
Dec 15, 2018
64
18
8
25
Denver, Colorado
It's okay if the service is running, as long as the bluetooth functionality itself is powered off.
 

Members online

No members online now.

Latest posts

Latest projects

Forum statistics

Threads
104
Messages
527
Unanswered questions
1
Members
65
Latest member
cloudtoad