Bug 240875 - usr.sbin/sysrc: If the file to be modified does not exist, an error message is displayed
Summary: usr.sbin/sysrc: If the file to be modified does not exist, an error message i...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-rc mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-09-27 15:02 UTC by Jose Luis Duran
Modified: 2019-09-29 08:48 UTC (History)
1 user (show)

See Also:


Attachments
sysrc.subr patch obtained from https://github.com/freebsd/poudriere/pull/708#issuecomment-526753174 (441 bytes, patch)
2019-09-27 15:02 UTC, Jose Luis Duran
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jose Luis Duran 2019-09-27 15:02:24 UTC
Created attachment 207890 [details]
sysrc.subr patch obtained from https://github.com/freebsd/poudriere/pull/708#issuecomment-526753174

Currently, with sysrc, if the file to be modified does not exist, an error message is displayed.

In this case, there is no /etc/rc.conf:

    root@test:~ # sysrc hostname="test.example.com"
    awk: can't open file /etc/rc.conf
     source line number 1
    hostname:  -> test.example.com

The patch fixes this situation.

This patch was created by @dteske, obtained from https://github.com/freebsd/poudriere/pull/708#issuecomment-526753174