66: clean default $PATH, change system-dir.

This commit is contained in:
mobinmob 2021-02-15 15:55:47 +02:00 committed by Érico Nogueira Rolim
parent f6e4df232d
commit 4a7953e544
3 changed files with 65 additions and 7 deletions

View file

@ -1,4 +1,6 @@
CAUTION: 66 v0.6.0.0 has changes to the way the log and env options
are handled in the frontend service file. Please consult the
documentation and make the appropriate changes before restarting
or enabling your services, especially complex module services.
CAUTION: package revision 0.6.1.1_2 changes the default system-dir
from /var/lib/66 to /etc/66/lib. The change requires user intervention.
Users who upgrade from an earlier version should either copy the
contents of the old dir to the new one after installation, or re-create
trees and re-enable services. That should be done before rebooting/halting
the system.

View file

@ -0,0 +1,47 @@
diff --git a/src/66/66-inservice.c b/src/66/66-inservice.c
index cfe5995e4fb861b749edca9a324f0207f26facc7..03fda5587df20e796300333c2db9d4847b1aa5b9 100644
--- a/src/66/66-inservice.c
+++ b/src/66/66-inservice.c
@@ -621,6 +621,7 @@ static void info_display_envfile(char const *field,ss_resolve_t *res)
FOREACH_SASTR(&list,pos) {
+ ssize_t upstream = 0 ;
sa.len = 0 ;
salink.len = newlen ;
if (!stralloc_cats(&salink,"/") ||
@@ -630,8 +631,25 @@ static void info_display_envfile(char const *field,ss_resolve_t *res)
if (!file_readputsa_g(&sa,salink.s))
log_dieusys(LOG_EXIT_SYS,"read environment file") ;
- if (NOFIELD) {
+ /** Remove warning message */
+ if (list.s[pos] == '.') {
+
+ char t[sa.len + 1] ;
+
+ upstream = str_contain(sa.s,"[ENDWARN]") ;
+ if (upstream == -1)
+ log_die(LOG_EXIT_SYS,"invalid upstream configuration file! Do you have modified it? Tries to enable the service again.") ;
+
+ auto_strings(t,sa.s + upstream) ;
+
+ sa.len = 0 ;
+
+ if (!auto_stra(&sa,t))
+ log_die_nomem("stralloc") ;
+ }
+
+ if (NOFIELD) {
char *m = "environment variables from: " ;
size_t mlen = strlen(m) ;
@@ -640,6 +658,7 @@ static void info_display_envfile(char const *field,ss_resolve_t *res)
if (!stralloc_inserts(&sa,0,msg) ||
!stralloc_0(&sa))
log_die_nomem("stralloc") ;
+
}
if (pos)

View file

@ -1,14 +1,15 @@
# Template file for '66'
pkgname=66
version=0.6.1.1
revision=1
revision=2
wrksrc="66-v${version}"
build_style=configure
configure_args="--prefix=/usr
--with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps
--with-lib=${XBPS_CROSS_BASE}/usr/lib
--with-s6-log-timestamp=iso
--with-s6-log-user=_s6log"
--with-s6-log-user=_s6log
--with-system-dir=/etc/66/lib"
hostmakedepends="pkg-config lowdown"
makedepends="oblibs-devel skalibs-devel execline-devel s6-devel s6-rc-devel"
short_desc="Small tools built around s6 and s6-rc programs"
@ -18,11 +19,19 @@ homepage="http://web.obarun.org/software/"
changelog="https://framagit.org/Obarun/66/raw/master/NEWS.md"
distfiles="https://framagit.org/Obarun/66/-/archive/v${version}/66-v${version}.tar.bz2"
checksum=4f80d94851a8c26e9666ea0f274890fc3abb6185ca1fe9fd8e2ad71e27a2ade9
patch_args=" -Np1"
conf_files="/etc/66/init /etc/66/init.conf"
conf_files="/etc/66/init.conf"
system_accounts="_s6log"
pre_configure() {
# Clean the default $PATH for service scripts
vsed -i "s@PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin@PATH=/usr/bin:/usr/sbin@" \
"${wrksrc}/skel/init.conf"
}
post_install() {
vdoc README.md
vlicense LICENSE