Bug 207282 - news/nzbget: init script should allow different user than root
Summary: news/nzbget: init script should allow different user than root
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-17 17:11 UTC by lebel
Modified: 2016-03-29 14:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (toxic)


Attachments
example of an init script (546 bytes, application/x-shellscript)
2016-02-17 17:11 UTC, lebel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description lebel 2016-02-17 17:11:46 UTC
Created attachment 167114 [details]
example of an init script

the script for starting/stopping nzbget should be more "rc.subr" friendly if one wants to run nzbget as a non-root user (as it should).

In this sample, I put "nobody"/"nobody", but one could create a user named nzbget with proper group.

Optionally, the package should create a user nzbget if non exists and use that in the initscript.

Anyway.

Just a suggestion.  I manually replace the script with each update since the package overwrites it.
Comment 1 Mark Felder freebsd_committer 2016-03-18 13:01:24 UTC
Hello,

The standard way of launching nzbget as a different user is to use the "DaemonUsername" setting in nzbget.conf. I believe this is why the rc script doesn't create its own user or offer nzbget_user setting by default.
Comment 2 lebel 2016-03-18 13:49:24 UTC
Why, I wonder how I missed that flag in nzbget.conf.

I guess you can close the bug and maybe highlight the flag in the post-install output?
Comment 3 commit-hook freebsd_committer 2016-03-29 14:05:40 UTC
A commit references this bug:

Author: feld
Date: Tue Mar 29 14:05:14 UTC 2016
New revision: 412111
URL: https://svnweb.freebsd.org/changeset/ports/412111

Log:
  news/nzbget: Add pkg-message to inform users how to drop privs

  PR:		207282

Changes:
  head/news/nzbget/Makefile
  head/news/nzbget/files/pkg-message.in