systemd unit file note #3243

Closed
opened 2025-12-29 18:27:02 +01:00 by adam · 13 comments
Owner

Originally created by @oidz1234 on GitHub (Jan 29, 2020).

Change Type

[X ] Addition
[ ] Correction
[ ] Deprecation
[ ] Cleanup (formatting, typos, etc.)

Proposed Changes

I would like to contribute a note to the documentation. It will inform the reader of the need to change the user the services are running as. The reason for this is that on different distributions Apache runs as different users. For example, On Ubuntu the user is "www-data" Whereas on CentOS it is "apache"

Originally created by @oidz1234 on GitHub (Jan 29, 2020). <!-- Please indicate the nature of the change by placing an X in one of the boxes below. --> ### Change Type [X ] Addition [ ] Correction [ ] Deprecation [ ] Cleanup (formatting, typos, etc.) <!-- Describe the proposed change(s). --> ### Proposed Changes I would like to contribute a note to the documentation. It will inform the reader of the need to change the user the services are running as. The reason for this is that on different distributions Apache runs as different users. For example, On Ubuntu the user is "www-data" Whereas on CentOS it is "apache"
adam added the type: documentation label 2025-12-29 18:27:02 +01:00
adam closed this issue 2025-12-29 18:27:02 +01:00
Author
Owner

@dsg-anthony commented on GitHub (Jan 29, 2020):

Should users use the www-data/apache user or should users create a separate user to run the netbox service?

@dsg-anthony commented on GitHub (Jan 29, 2020): Should users use the www-data/apache user or should users create a separate user to run the netbox service?
Author
Owner

@oidz1234 commented on GitHub (Jan 29, 2020):

I belive it to be fine to use whatever the default system user that apache runs as.

@oidz1234 commented on GitHub (Jan 29, 2020): I belive it to be fine to use whatever the default system user that apache runs as.
Author
Owner

@jeremystretch commented on GitHub (Jan 29, 2020):

What specifically do you want to add/change?

@jeremystretch commented on GitHub (Jan 29, 2020): What specifically do you want to add/change?
Author
Owner

@oidz1234 commented on GitHub (Jan 30, 2020):

I would like to add a small note about making sure your netbox systemd service is running under the correct user.
Please see this closed PR:
https://github.com/netbox-community/netbox/pull/4042

@oidz1234 commented on GitHub (Jan 30, 2020): I would like to add a small note about making sure your netbox systemd service is running under the correct user. Please see this closed PR: https://github.com/netbox-community/netbox/pull/4042
Author
Owner

@DanSheps commented on GitHub (Jan 30, 2020):

I do think we should have something, not sure what the best way to phrase it would be.

Nginx runs as nobody or nginx on Centos by default, I can't remember which though

@DanSheps commented on GitHub (Jan 30, 2020): I do think we should have something, not sure what the best way to phrase it would be. Nginx runs as nobody or nginx on Centos by default, I can't remember which though
Author
Owner

@dsg-anthony commented on GitHub (Jan 30, 2020):

You could just create a new system user

useradd -r netbox

This should work on all mainstream Linux distros and reduce the confusion on what account to run with. 😉

It does add a bit of confusion when managing file permissions though.

@dsg-anthony commented on GitHub (Jan 30, 2020): You could just create a new system user `useradd -r netbox` This should work on all mainstream Linux distros and reduce the confusion on what account to run with. 😉 It does add a bit of confusion when managing file permissions though.
Author
Owner

@oidz1234 commented on GitHub (Feb 3, 2020):

I think using the default system user for installation is best practice. Also I have only installed netbox under Apache. If default Nginx user differs between distributions then this will also need a note.

Or just have a note making sure the user checks?

@oidz1234 commented on GitHub (Feb 3, 2020): I think using the default system user for installation is best practice. Also I have only installed netbox under Apache. If default Nginx user differs between distributions then this will also need a note. Or just have a note making sure the user checks?
Author
Owner

@candlerb commented on GitHub (Feb 3, 2020):

I'd say creating a distinct 'netbox' user is best practice (and this is what I do). If you have multiple web apps on a server, then for security you want them all running as distinct uids, not all as "www-data" or whatever.

There is some potential for confusion for existing users though, if the documentation now changes to using a "netbox" user.

@candlerb commented on GitHub (Feb 3, 2020): I'd say creating a distinct 'netbox' user is best practice (and this is what I do). If you have multiple web apps on a server, then for security you want them all running as distinct uids, not all as "www-data" or whatever. There is some potential for confusion for existing users though, if the documentation now changes to using a "netbox" user.
Author
Owner

@oidz1234 commented on GitHub (Feb 4, 2020):

If that is the agreed method then fine. Although there will be many more places (I expect) In the documentation that will need to be updated also.

@oidz1234 commented on GitHub (Feb 4, 2020): If that is the agreed method then fine. Although there will be many more places (I expect) In the documentation that will need to be updated also.
Author
Owner

@DanSheps commented on GitHub (Feb 4, 2020):

I think the only issue with this is certain files need to be readable by the webserver, so either they need to be chgrp to the webserver group or world readable.

Both of which adds an additional step to ensure everything is good.

@DanSheps commented on GitHub (Feb 4, 2020): I think the only issue with this is certain files need to be readable by the webserver, so either they need to be chgrp to the webserver group or world readable. Both of which adds an additional step to ensure everything is good.
Author
Owner

@jeremystretch commented on GitHub (Feb 4, 2020):

Let's be cognizant of the scope of the documentation we provide. It's very easy to wander away from installing NetBox to discussing alternative installations, best configuration practices, and so on. The installation docs have always assumed a basic level of understanding around configuring an HTTP service, which includes determining the user under which the service should run.

I think it's fine to mention creating a "netbox" user as an option, but let's not deviate any further from what exists today.

@jeremystretch commented on GitHub (Feb 4, 2020): Let's be cognizant of the scope of the documentation we provide. It's very easy to wander away from installing NetBox to discussing alternative installations, best configuration practices, and so on. The installation docs have always assumed a basic level of understanding around configuring an HTTP service, which includes determining the user under which the service should run. I think it's fine to mention creating a "netbox" user as an option, but let's not deviate any further from what exists today.
Author
Owner

@stale[bot] commented on GitHub (Mar 6, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Mar 6, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Mar 6, 2020):

This was ultimately addressed during the alteration of the installation instructions under #3949.

@jeremystretch commented on GitHub (Mar 6, 2020): This was ultimately addressed during the alteration of the installation instructions under #3949.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3243