systemctl enable --now #7187

Closed
opened 2025-12-29 20:20:17 +01:00 by adam · 3 comments
Owner

Originally created by @PenelopeFudd on GitHub (Nov 1, 2022).

Change Type

Addition

Area

Installation/upgrade

Proposed Changes

On https://docs.netbox.dev/en/stable/installation/4-gunicorn/ , the commands

sudo systemctl start netbox netbox-rq
sudo systemctl enable netbox netbox-rq

Could be simplified to

sudo systemctl enable --now netbox netbox-rq
Originally created by @PenelopeFudd on GitHub (Nov 1, 2022). ### Change Type Addition ### Area Installation/upgrade ### Proposed Changes On https://docs.netbox.dev/en/stable/installation/4-gunicorn/ , the commands ``` sudo systemctl start netbox netbox-rq sudo systemctl enable netbox netbox-rq ``` Could be simplified to ``` sudo systemctl enable --now netbox netbox-rq ```
adam added the type: documentation label 2025-12-29 20:20:17 +01:00
adam closed this issue 2025-12-29 20:20:17 +01:00
Author
Owner

@DanSheps commented on GitHub (Nov 2, 2022):

Not every version of Linux supports the now flag, notibly a large number of CentOS 7 boxes (it is EoL I believe but it is still very much out there).

I think we can add it as a option, but I think preserving the current functionality makes more sense currently.

Important caveat with this:

The start or stop operation is only carried out when the respective enable or disable operation has been successful.

@DanSheps commented on GitHub (Nov 2, 2022): Not every version of Linux supports the now flag, notibly a large number of CentOS 7 boxes (it is EoL I believe but it is still very much out there). I think we can add it as a option, but I think preserving the current functionality makes more sense currently. Important caveat with this: > The start or stop operation is only carried out when the respective enable or disable operation has been successful.
Author
Owner

@PenelopeFudd commented on GitHub (Nov 2, 2022):

Huh. TIL! :-)

I'm having difficulty thinking of a situation where it's not possible to enable/disable yet it is possible to start/stop. Would that be if it's already been enabled/disabled (e.g. "you can't disable that, it's already disabled"), or maybe if the service file has been deleted? In those cases, I'm not sure how systemd would know how to start or stop the service, the required definitions would have been deleted from memory. Or at least, that's how I'm imagining it, I haven't tested it.

The more I read the installation instructions, the more I like them; they're solid. In fact, they're good enough that they could be turned into an interactive shell script without much difficulty. Initially, anyway. :-)

@PenelopeFudd commented on GitHub (Nov 2, 2022): Huh. TIL! :-) I'm having difficulty thinking of a situation where it's not possible to enable/disable yet it is possible to start/stop. Would that be if it's already been enabled/disabled (e.g. "you can't disable that, it's already disabled"), or maybe if the service file has been deleted? In those cases, I'm not sure how systemd would know how to start or stop the service, the required definitions would have been deleted from memory. Or at least, that's how I'm imagining it, I haven't tested it. The more I read the installation instructions, the more I like them; they're solid. In fact, they're good enough that they could be turned into an interactive shell script without much difficulty. Initially, anyway. :-)
Author
Owner

@jeremystretch commented on GitHub (Dec 13, 2022):

Thanks for the suggestion, but I'm going to close this as it doesn't seem to be a necessary change, and including it apparently might cause problems for some users.

@jeremystretch commented on GitHub (Dec 13, 2022): Thanks for the suggestion, but I'm going to close this as it doesn't seem to be a necessary change, and including it apparently might cause problems for some users.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7187