Bug 234627 - devel/py-buildbot-worker: Fails to startup on boot: /etc/rc: Permission denied (due to use of $0)
Summary: devel/py-buildbot-worker: Fails to startup on boot: /etc/rc: Permission denie...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kubilay Kocak
URL:
Keywords:
Depends on: 234614
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-05 02:13 UTC by Kubilay Kocak
Modified: 2021-12-02 01:37 UTC (History)
1 user (show)

See Also:
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kubilay Kocak freebsd_committer freebsd_triage 2019-01-05 02:13:17 UTC
In ports r484380 I switched from using %%PREFIX%%/etc/${name} to $0 in the rc script for the profile mechanism, in order to:

    Fix startup script to use the filename of itself (the executed script),
    not a filename that uses the ${name} variable, which doesnt exist as it
    contains an underscore (not a dash), causing the following error when
    executed:

    /usr/local/etc/rc.d/buildbot-worker: /usr/local/etc/rc.d/buildbot_worker:
not found

I forgot that using $0 causes issues on boot, as $0 is not the rc scripts filename when run via /etc/rc, it is 'etc/rc' instead.

After talking with Kyle about correct/permanent solutions to the issue, bug 234614 now tracks a new feature in rc to provide a variable for scripts to use to self-reference themselves for profile or other mechanisms. 

I'll wait until that feature is finalised, and plug in (copy) the same functionality for temporary use directly in this ports rc script, until all supported FreeBSD versions carry the new feature.
Comment 1 ari 2021-06-02 04:17:25 UTC
I see the rc.d script is now buildbot-worker with a hyphen, so can this ticket be closed?
Comment 2 ari 2021-12-02 01:31:31 UTC
Would you like to close this ticket now? I think it is resolved.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2021-12-02 01:37:18 UTC
Thanks Ari