Skip to content

Commit

Permalink
busybox: preserve crontabs
Browse files Browse the repository at this point in the history
/etc/syslog.conf is used by sysklogd, and /etc/crontabs is used
by crond, both features of busybox.  Given this, ownership for
these files should be bound to busybox, especially if one day
there's a way to do an in-place opkg update of busybox.

There's also the busybox provided syslogd which uses this file
if CONFIG_BUSYBOX_FEATURE_SYSLOGD_CFG is set.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
  • Loading branch information
pprindeville authored and aparcar committed May 19, 2021
1 parent b36b8b6 commit b810d64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 0 additions & 1 deletion package/base-files/Makefile
Expand Up @@ -47,7 +47,6 @@ define Package/base-files/conffiles
/etc/config/
/etc/config/network
/etc/config/system
/etc/crontabs/
/etc/dropbear/
/etc/ethers
/etc/group
Expand Down
21 changes: 18 additions & 3 deletions package/utils/busybox/Makefile
Expand Up @@ -73,14 +73,25 @@ define Package/busybox/config
source "$(SOURCE)/Config.in"
endef

ifdef CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG
define Package/busybox/conffiles
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOG)$(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOGD_CFG),)
define Package/busybox/conffiles/syslog
/etc/syslog.conf
endef
endif

Package/busybox-selinux/conffiles = $(Package/busybox/conffiles)
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_CROND),)
define Package/busybox/conffiles/crond
/etc/crontabs/
endef
endif

define Package/busybox/conffiles
$(Package/busybox/conffiles/syslog)
$(Package/busybox/conffiles/crond)
endef

Package/busybox-selinux/conffiles = $(Package/busybox/conffiles)

ifndef CONFIG_USE_MUSL
LDLIBS:=m crypt
endif
Expand Down Expand Up @@ -129,8 +140,12 @@ define Package/busybox/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOG)$(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOGD_CFG),)
touch $(1)/etc/syslog.conf
endif
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_CROND),)
$(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
$(INSTALL_DIR) $(1)/etc/crontabs
endif
ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_NTPD),)
$(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd
Expand Down

0 comments on commit b810d64

Please sign in to comment.