Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • dev
  • 0.4.0
  • 0.4.1
  • 0.4.2
  • 0.4.3
  • 0.8.0
  • 0.8.1
  • v0.1.0
  • v0.2.0
  • v0.2.1
  • v0.3.0
  • v0.3.1
13 results

Target

Select target project
No results found
Select Git revision
  • overlay
  • debian
  • debian-0.8.0.0
  • master
  • debian-0.7.0.0
  • debian-0.7.x.x
  • debian-dev
  • dev
  • 0.4.0
  • 0.4.1
  • 0.4.2
  • 0.8.1
  • debian/0.4.2-experimental1
  • upstream/0.4.2
  • v0.1.0
  • v0.2.0
  • v0.2.1
  • v0.3.0
  • v0.3.1
19 results
Show changes

Commits on Source 24

15 files
+ 337
245
Compare changes
  • Side-by-side
  • Inline

Files

+3 −11
Original line number Original line Diff line number Diff line
Copyright (c) 2015-2020 Eric Vidal <eric@obarun.org>
Copyright (c) 2024 Eric Vidal <eric@obarun.org>
All rights reserved.
All rights reserved.


Permission to use, copy, modify, and/or distribute this software for any
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.


THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+15 −31
Original line number Original line Diff line number Diff line
@@ -15,39 +15,23 @@ include package/targets.mak


INSTALL := ./tools/install.sh
INSTALL := ./tools/install.sh


install: install-script install-service install-service-module install-service-instance-module install-configure
install: install-module install-script
install-script: $(SCRIPT_TARGET:module/scandir@/configure/%=$(DESTDIR)$(module_directory)/scandir@/configure/%)
install-module: $(MODULE_TARGET:module/%=$(DESTDIR)$(service_directory)/$(package)/%)
install-service: $(SERVICE_TARGET:service/%=$(DESTDIR)$(service_directory)/%)
install-script: $(SCRIPT_TARGET:module/configure/%=$(DESTDIR)$(service_directory)/$(package)/configure/%)
install-service-module: $(MODULE_TARGET:module/scandir@/service/%=$(DESTDIR)$(module_directory)/scandir@/service/%)
install-service-instance-module: $(MODULE_INSTANCE_TARGET:module/scandir@/service@/%=$(DESTDIR)$(module_directory)/scandir@/service@/%)
install-configure: $(MODULE_CONFIGURE_TARGET:module/scandir@/configure/configure=$(DESTDIR)$(module_directory)/scandir@/configure/configure)



$(DESTDIR)$(service_directory)/$(package)/%: module/%
$(DESTDIR)$(module_directory)/scandir@/configure/%: module/scandir@/configure/%
	exec $(INSTALL) -D -m 755 $< $@
	sed -i -e 's,@BINDIR@,$(bindir),' $@

$(DESTDIR)$(module_directory)/scandir@/configure/configure: module/scandir@/configure/configure
	exec $(INSTALL) -D -m 755 $< $@
	sed -i -e 's,@BINDIR@,$(bindir),' $@

$(DESTDIR)$(module_directory)/scandir@/service/%: module/scandir@/service/%
	exec $(INSTALL) -D -m 644 $< $@

$(DESTDIR)$(module_directory)/scandir@/service@/%: module/scandir@/service@/%
	exec $(INSTALL) -D -m 644 $< $@



$(DESTDIR)$(service_directory)/%: service/%
	exec $(INSTALL) -D -m 644 $< $@
	exec $(INSTALL) -D -m 644 $< $@
	sed -i -e 's,@VERSION@,$(version),' \
	sed -i -e 's,%%VERSION%,$(version),' \
		-e "s,@LIVEDIR@,$(livedir)," \
		-e "s,%%LIVEDIR%%,$(livedir)," \
		-e "s,@USER_CONF_DIR@,$(service_userconf)," \
		-e "s,%%USER_CONF_DIR%%,$(service_userconf)," \
		-e "s,@LOGGER@,$(LOGGER)," \
		-e "s,%%LOGGER%%,$(LOGGER)," \
		-e "s,@USE_ENVIRONMENT@,$(USE_ENVIRONMENT)," \
		-e "s,%%USE_ENVIRONMENT%%,$(USE_ENVIRONMENT)," \
		-e "s,@VERBOSITY_LEVEL@,$(VERBOSITY_LEVEL)," \
		-e "s,%%VERBOSITY_LEVEL%%,$(VERBOSITY_LEVEL)," \
		-e "s,@NOTIFY@,$(NOTIFY)," $@
		-e "s,%%NOTIFY%%,$(NOTIFY)," $@

$(DESTDIR)$(service_directory)/$(package)/configure/%: module/configure/%
	exec $(INSTALL) -D -m 755 $< $@
	sed -i -e 's,%%BINDIR%%,$(bindir),' $@


version:
version:
	@echo $(version)
	@echo $(version)
+77 −1
Original line number Original line Diff line number Diff line
@@ -2,6 +2,82 @@


---
---


# In 0.8.1

- Bugfix: use of new keyword format at `[Regex]` section

---

# In 0.8.0

- Adapt to new format of 66 release 0.8.0

---

# In 0.4.3

- Fix seed directory replacement at documentation page.
- Avoid conflicting identifier between Makefile and 66 identifier for frontend file.
- Prepare for the next 66 release.

---

# In 0.4.2

- Adapt to 66 version 0.7.0 stable

- Allow to declare version at configure invocation

---

# In 0.4.1

- Adapt to 66 0.7.0.0-beta2

- Fix replacement of variable value

---

# In 0.4.0

- Adapt to execline 2.9.4.0

- Adapt to 66 0.7.0.0-beta

- Adapt to 66-tools 0.1.0.0

---

# In 0.3.1

- Follow 66 envfile behavior: the $HOME/.66/svscan@<user>/.svscan@<user> is now created with a dot.

---

# In 0.3.0

- Adapt to execline 2.7.0.0

- Adapt to 66 0.6.0.0

---

# In 0.2.1

- Convenient release to udpate dependencies:
    - 66 v0.5.1.0
    - 66-tools v0.0.6.2
    - optional dependency:
        - dbus-66serv 0.2.0 for environment configuration

---

# In 0.2.0

- Adapt to 66 v0.4.0.1

---

# In 0.1.0
# In 0.1.0


- first commit
- first commit
Original line number Original line Diff line number Diff line
@@ -17,7 +17,8 @@ You can customize paths via flags given to configure. See `./configure --help` f


## Runtime dependencies
## Runtime dependencies


- execline version 2.6.0.2 or later: http://skarnet.org/software/execline/
- execline version 2.9.6.1 or later: http://skarnet.org/software/execline/
- s6 version 2.9.1.0 or later: http://skarnet.org/software/s6/
- s6 version 2.13.1.0 or later: http://skarnet.org/software/s6/
- 66 version 0.4.0.0 or later https://framagit.org/Obarun/66/
- 66 version 0.8.0.0 or later: https://git.obarun.org/Obarun/66/
- 66-tools version 0.0.4.0 or later https://framagit.org/Obarun/66-tools/
- 66-tools version 0.1.1.0 or later: https://git.obarun.org/Obarun/66-tools/
+9 −10
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@ Fine tuning of the installation directories:
  --bindir=BINDIR                  user executables [EPREFIX/bin]
  --bindir=BINDIR                  user executables [EPREFIX/bin]
  --datarootdir=DATAROOTDIR        read-only architecture-independent data root [PREFIX/share]
  --datarootdir=DATAROOTDIR        read-only architecture-independent data root [PREFIX/share]
  --with-system-service=DIR        66 service intallation directory [DATAROOTDIR/$package_macro_dir/service]
  --with-system-service=DIR        66 service intallation directory [DATAROOTDIR/$package_macro_dir/service]
  --with-system-module=DIR         66 module intallation directory [DATAROOTDIR/$package_macro_dir/module]
  --livedir=DIR                    66 default live directory [/run/66]
  --livedir=DIR                    66 default live directory [/run/66]
  --with-user-service-conf=DIR     66 user service configuration directory [.66/conf]
  --with-user-service-conf=DIR     66 user service configuration directory [.66/conf]


@@ -25,6 +24,7 @@ Fine tunning of scandir configuration:
  --USE_ENVIRONMENT=BOOLEAN        Launch the scandir with a environment [!yes]
  --USE_ENVIRONMENT=BOOLEAN        Launch the scandir with a environment [!yes]
  --NOTIFY=BOOLEAN                 use notification [!yes]
  --NOTIFY=BOOLEAN                 use notification [!yes]
  --VERBOSITY_LEVEL=BOOLEAN        level of verbosity [!3]
  --VERBOSITY_LEVEL=BOOLEAN        level of verbosity [!3]
  --version=VALUE                  version of the service[0.0.1]


 Use yes or no with lowercase character to set BOOLEAN values.
 Use yes or no with lowercase character to set BOOLEAN values.


@@ -91,13 +91,13 @@ exec_prefix='$prefix'
bindir='$exec_prefix/bin'
bindir='$exec_prefix/bin'
datarootdir='$prefix/share'
datarootdir='$prefix/share'
service_directory='$datarootdir/$package_macro_dir/service'
service_directory='$datarootdir/$package_macro_dir/service'
module_directory='$datarootdir/$package_macro_dir/module'
livedir='/run/66'
livedir='/run/66'
service_userconf='.66/conf'
service_userconf='.66/conf'
LOGGER='!yes'
LOGGER='!yes'
USE_ENVIRONMENT='!yes'
USE_ENVIRONMENT='!yes'
NOTIFY='!yes'
NOTIFY='!yes'
VERBOSITY_LEVEL='!3'
VERBOSITY_LEVEL='!3'
version='0.4.3'


for arg ; do
for arg ; do
  case "$arg" in
  case "$arg" in
@@ -107,13 +107,13 @@ for arg ; do
    --bindir=*) bindir=${arg#*=} ;;
    --bindir=*) bindir=${arg#*=} ;;
    --datarootdir=*) datarootdir=${arg#*=} ;;
    --datarootdir=*) datarootdir=${arg#*=} ;;
    --with-system-service=*) service_directory=${arg#*=} ;;
    --with-system-service=*) service_directory=${arg#*=} ;;
    --with-system-module=*) module_directory=${arg#*=} ;;
    --livedir=*) livedir=${arg#*=} ;;
    --livedir=*) livedir=${arg#*=} ;;
    --with-user-service-conf=*) service_userconf=${arg#*=} ;;
    --with-user-service-conf=*) service_userconf=${arg#*=} ;;
    --LOGGER=*) LOGGER=${arg#*=} ;;
    --LOGGER=*) LOGGER=${arg#*=} ;;
    --USE_ENVIRONMENT=*) USE_ENVIRONMENT=${arg#*=} ;;
    --USE_ENVIRONMENT=*) USE_ENVIRONMENT=${arg#*=} ;;
    --NOTIFY=*) NOTIFY=${arg#*=} ;;
    --NOTIFY=*) NOTIFY=${arg#*=} ;;
    --VERBOSITY_LEVEL=*) VERBOSITY_LEVEL=${arg#*=} ;;
    --VERBOSITY_LEVEL=*) VERBOSITY_LEVEL=${arg#*=} ;;
    --version=*) version=${arg#*=} ;;
    -* ) echo "$0: unknown option $arg" ;;
    -* ) echo "$0: unknown option $arg" ;;
    *=*) ;;
    *=*) ;;
    *) target=$arg ;;
    *) target=$arg ;;
@@ -130,14 +130,14 @@ fi
# Expand installation directories
# Expand installation directories
stripdir prefix
stripdir prefix
for i in exec_prefix bindir datarootdir \
for i in exec_prefix bindir datarootdir \
		livedir service_directory module_directory ; do
		livedir service_directory; do
  eval tmp=\${$i}
  eval tmp=\${$i}
  eval $i=$tmp
  eval $i=$tmp
  stripdir $i
  stripdir $i
done
done


stripdir datarootdir
stripdir datarootdir
for i in service_directory module_directory; do
for i in service_directory; do
  eval tmp=\${$i}
  eval tmp=\${$i}
  eval $i=$tmp
  eval $i=$tmp
  stripdir $i
  stripdir $i
@@ -174,14 +174,13 @@ cat << EOF
# This file was generated by:
# This file was generated by:
# $cmdline
# $cmdline
# Any changes made here will be lost if configure is re-run.
# Any changes made here will be lost if configure is re-run.

version := $version
version := $version
package := $package
prefix := $prefix
prefix := $prefix
exec_prefix := $exec_prefix
exec_prefix := $exec_prefix
bindir := $bindir
bindir := $bindir
datarootdir := $datarootdir
datarootdir := $datarootdir
service_directory := $service_directory
service_directory := $service_directory
module_directory := $module_directory
package_macro_dir := $package_macro_dir
package_macro_dir := $package_macro_dir
livedir := $livedir
livedir := $livedir
service_userconf := $service_userconf
service_userconf := $service_userconf
+96 −0
Original line number Original line Diff line number Diff line
#!%%BINDIR%%/sh

## 66-yeller variable
export PROG="${MOD_NAME}"
export VERBOSITY="${MOD_VERBOSITY}"
export CLOCK_ENABLED=0
export COLOR_ENABLED="${MOD_COLOR}"

## script variable
FRONTEND_PATH="${MOD_MODULE_DIR}/frontend"
ACTIVATED_PATH="${MOD_MODULE_DIR}/activated"

owner="${1}"
home_env=$(homeof "${owner}" 2>/dev/null)
home_env="${home_env}/${MOD_SERVICE_USERCONFDIR}svscan@${owner}"
svscan="${FRONTEND_PATH}/svscan@"

die(){
  66-yeller -f "${@}"
  exit 111
}

if [ -z "${home_env}" ]; then
    die "invalid user: ${owner}"
fi

check_empty_var(){
    name="${1}" var_value="${2}"
    if [ -z "${var_value}" ]; then
        die invalid value for variable: "${name}"
    fi
}

disable() {
    name=${1}
    66-yeller %rdisable%n service: "${name}"
    sed -i "s:${name}:#${name}:g" "${svscan}" || die "unable to sed ${service_dir}/scandir@"
}

enable() {
    name=${1}
    66-yeller %benable%n service: "${name}"
    touch "${ACTIVATED_PATH}/${name}"
}

absolute_path(){
    name="${1}" var="${2}"
    if [ "$(66-yeller -i "${var}" | cut -c 1)" != "/" ]; then
        die "${name}" must be an absolute path
    fi
}

if execl-toc -X -V LIVE_DIRECTORY; then

    check_empty_var "LIVE_DIRECTORY" "${LIVE_DIRECTORY}"

    absolute_path "LIVE_DIRECTORY" "${LIVE_DIRECTORY}"

    66-yeller set live directory to: %b"${LIVE_DIRECTORY}"%n
    sed -i "s:%%livedir%%:-l ${LIVE_DIRECTORY}:" "${svscan}" || die "unable to set the live directory to use"
else
    66-yeller set live directory to: %b${MOD_LIVE}%n
    sed -i "s:%%livedir%%:-l ${MOD_LIVE}:" "${svscan}" || die "unable to set the live directory to use"
fi

if [ "${USE_ENVIRONMENT}" = yes ]; then

    enable "setenv@${owner}"

    sed -i "s:%%use_environment%%:-e ${home_env}:" "${svscan}" || die "unable to set environment directory to use"
    sed -i "s:%%environment_path%%:${home_env}:g" "${FRONTEND_PATH}/setenv@" || die "unable to set environment directory to use"
else
    disable "setenv@@I"
    sed -i "s:%%use_environment%%::" "${svscan}" || die "unable to set environment directory to use"
fi

if [ "${LOGGER}" != "yes" ]; then
    66-yeller %rdisable%n logger options
    sed -i "s:log:!log:" "${svscan}" || die "unable to disable log options"
else
    66-yeller %benable%n logger options
fi

if [ "${NOTIFY}" != "yes" ]; then
    66-yeller %rdisable%n notification
    sed -i "s:%%notify%%::" "${svscan}" || die "unable to disable notification"
    sed -i "s:Notify:#Notify:" "${svscan}" || die "unable to disable notification"
else
    66-yeller %benable%n notification
    sed -i "s:%%notify%%:-d3:" "${svscan}" || die "unable to enable notification"
fi

66-yeller set verbosity level to: %b"${VERBOSITY_LEVEL}"%n
sed -i "s:%%verbosity_level%%:-v${VERBOSITY_LEVEL}:" "${svscan}" || die "unable to set verbosity"

66-yeller "%bsuccessfully%n configured"
+62 −0
Original line number Original line Diff line number Diff line
[Main]
Type = oneshot
Version = %%version%%
Description = "Set well-know variables for @I user"
User = ( root )

[Start]
RunAs = @I
Execute =
(
    execl-subuidgid
    backtick -n HOME { homeof @I }
    importas -u HOME HOME

    execl-toc -v3 -d %%environment_path%%

    redirfd -w 1 %%environment_path%%/.svscan@@I

    ## GENERAL VARIABLES

    if { 66-echo -- HOME=${HOME} }
    if { 66-echo -- LOGNAME=@I }
    if { 66-echo -- USER=@I }

    foreground {
        importas PATH PATH
        66-echo -- PATH=${PATH}
    }
    foreground {
        backtick -D /usr/bin/sh -E shell {
            pipeline { getent passwd ${UID} }
            cut -d: -f7
        }
        66-echo -- SHELL=${shell}
    }
    foreground
    {
        backtick -E x
        {
            sh -c "d=0 ; while true ; do \
            if [ ! -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ]; then \
                66-echo -- $d ; \
                break ; \
            fi ; \
            d=$(($d + 1)) ; \
            done ;"
        }
        66-echo -- DISPLAY=:${x}
    }
    ## DBUS

    if { 66-echo -- DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${UID}/bus }

    ## XDG variables

    if { 66-echo -- XDG_RUNTIME_DIR=/run/user/${UID} }
    if { 66-echo -- XDG_CACHE_HOME=${HOME}/.cache }
    if { 66-echo -- XDG_CONFIG_HOME=${HOME}/.config }
    if { 66-echo -- XDG_DATA_HOME=${HOME}/.local/share }
    if { 66-echo -- XDG_DATA_DIRS=${HOME}/.local/share:/usr/local/share:/usr/share }
    66-echo -- XDG_SESSION_CLASS=user
)
+28 −0
Original line number Original line Diff line number Diff line
[Main]
Type = classic
Version = %%version%%
Description = "Create and start a nested scandir for @I"
User = ( root )
Depends = ( setenv@@I )
Notify = 3
TimeoutStart = 3000
Options = ( log )

[Start]
RunAs = @I
Execute = (
    s6-setsid -qb --
    umask 022
    execl-cmdline -s { 66 ${Args66} scandir ${ArgsScandirStart} }
)

[Stop]
RunAs = @I
Execute = (
    execl-cmdline -s { 66 ${Args66} scandir ${ArgsScandirStop} }
)

[Environment]
Args66=!%%verbosity_level%% %%livedir%%
ArgsScandirStart=!start %%notify%% %%use_environment%%
ArgsScandirStop=!stop
Original line number Original line Diff line number Diff line
[main]
[Main]
@type = module
Type = module
@version = @VERSION@
Version = %%VERSION%
@description = "Create a nested scandir for @I"
Description = "Create a nested scandir for @I"
@user = ( root )
User = ( root )
@options = ( env )
InTree = session


[regex]
[Regex]
@configure="@I"
Configure="@I"
@files = ( @M=@I )
Files = ( @M=@I )
@infiles = ( ::@version@=@VERSION@ )
InFiles = (

::%%version%%=%%VERSION% )
[environment]

[Environment]
## Run the scandir at LIVE_DIRECTORY.
## Run the scandir at LIVE_DIRECTORY.
## Need to be an absolute path.
## Need to be an absolute path.
## If commented the default is @LIVEDIR@
## If commented the default is %%LIVEDIR%%


#LIVE_DIRECTORY=@LIVEDIR@
#LIVE_DIRECTORY=%%LIVEDIR%%


## Create an associated logger [yes|no]
## Create an associated logger [yes|no]


@LOGGER@
%%LOGGER%%


## Launch the scandir with a environment [yes|no].
## Launch the scandir with a environment [yes|no].
## The environment directory is: $HOME/@USER_CONF_DIR@/svscan@@I
## The environment directory is: $HOME/%%USER_CONF_DIR%%/svscan@@I


@USE_ENVIRONMENT@
%%USE_ENVIRONMENT%%


## Use notification [yes|no]
## Use notification [yes|no]


@NOTIFY@
%%NOTIFY%%


## Level of verbosity [0-4]
## Level of verbosity [0-5]


@VERBOSITY_LEVEL@
%%VERBOSITY_LEVEL%%
+0 −91
Original line number Original line Diff line number Diff line
#!@BINDIR@/sh

## 66-yeller variable
export PROG="${MOD_NAME}"
export VERBOSITY="${MOD_VERBOSITY}"
export CLOCK_ENABLED=0

owner="${1}"
home_env=$(homeof "${owner}")
home_env="${home_env}/${MOD_SERVICE_USERCONFDIR}svscan@${owner}"

service_dir="${MOD_MODULE_DIR}/service@"
svscan="${service_dir}/svscan@"

die(){
  66-yeller -f "${@}"
  exit 111
}

check_empty_var(){
	name="${1}" var_value="${2}"
	if [ -z "${var_value}" ]; then
		die invalid value for variable: "${name}"
	fi
}

disable() {
	name=${1}
	66-yeller %rdisable%n service: "${name}"
	sed -i "s:${name}:#${name}:g" "${svscan}" || die "unable to sed ${service_dir}/scandir@"
}

enable() {
	name=${1}
	66-yeller %benable%n service: "${name}"
	touch "${MOD_MODULE_DIR}/service/${name}"
}


absolute_path(){
	name="${1}" var="${2}"
	if [ "$(66-yeller -i "${var}" | cut -c 1)" != "/" ]; then
		die "${name}" must be an absolute path
	fi
}

if execl-toc -X -V LIVE_DIRECTORY; then
	
	check_empty_var "LIVE_DIRECTORY" "${LIVE_DIRECTORY}"
	
	absolute_path "LIVE_DIRECTORY" "${LIVE_DIRECTORY}"
	
	66-yeller set live directory to: %b"${LIVE_DIRECTORY}"%n
	sed -i "s:@LIVE_DIR@:-l ${LIVE_DIRECTORY}:" "${svscan}" || die "unable to set the live directory to use"
else
	66-yeller set live directory to: %b${MOD_LIVE}%n
	sed -i "s:@LIVE_DIR@:-l ${MOD_LIVE}:" "${svscan}" || die "unable to set the live directory to use"
fi


if [ "${USE_ENVIRONMENT}" = yes ]; then 
	
	enable "setenv@${owner}"
	
	sed -i "s:@USE_ENVIRONMENT@:-e ${home_env}:" "${svscan}" || die "unable to set environment directory to use"
	sed -i "s:@PATH_ENVIRONMENT@:${home_env}:g" "${service_dir}/setenv@" || die "unable to set environment directory to use"
else
	disable "setenv@@I"
	sed -i "s:@USE_ENVIRONMENT@::" "${svscan}" || die "unable to set environment directory to use"
fi

if [ "${LOGGER}" != "yes" ]; then
	66-yeller %rdisable%n logger options
	sed -i "s:@options:#@options:" "${svscan}" || die "unable to disable log options"
else
	66-yeller %benable%n logger options
fi

if [ "${NOTIFY}" != "yes" ]; then
	66-yeller %rdisable%n notification
	sed -i "s:@NOTIFY@::" "${svscan}" || die "unable to disable notification"
	sed -i "s:@notify:#@notify:" "${svscan}" || die "unable to disable notification"
else
	66-yeller %benable%n notification
	sed -i "s:@NOTIFY@:-d3:" "${svscan}" || die "unable to enable notification"
fi

66-yeller set verbosity level to: %b"${VERBOSITY_LEVEL}"%n
sed -i "s:@VERBOSITY_LEVEL@:-v${VERBOSITY_LEVEL}:" "${svscan}" || die "unable to disable log options"

66-yeller "%bsuccessfully%n configured"

module/scandir@/service@/setenv@

deleted100644 → 0
+0 −65
Original line number Original line Diff line number Diff line
[main]
@type = oneshot
@version = @version@
@description = "Set well-know variables for @I user"
@user = ( root )
@options = ( log )

[start]
@runas = @I
@execute = 
(
	execl-subuidgid
	backtick -n HOME { homeof @I }
	importas -u HOME HOME

	execl-toc -v3 -d @PATH_ENVIRONMENT@

	redirfd -w 1 @PATH_ENVIRONMENT@/svscan@@I

	## GENERAL VARIABLES

	if { 66-echo HOME=${HOME} }
	if { 66-echo LOGNAME=@I }
	if { 66-echo USER=@I }

	foreground { 
		importas PATH PATH 
		66-echo -- PATH=${PATH} 
	}
	foreground {
		backtick -D /usr/bin/sh -n shell {
			pipeline { getent passwd ${UID} }
			cut -d: -f7 
		}
		importas -u shell shell
		66-echo -- SHELL=${shell}
	}
	foreground 
	{
		backtick -n x 
		{
			sh -c "d=0 ; while true ; do \
			if [ ! -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ]; then \
				66-echo -- $d ; \
				break ; \
			fi ; \
			d=$(($d + 1)) ; \
			done ;"
		}
		importas -u x x
		66-echo -- DISPLAY=:${x}  
	}
	## DBUS

	if { 66-echo -- DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${UID}/bus }

	## XDG variables

	if { 66-echo -- XDG_RUNTIME_DIR=/run/user/${UID} }
	if { 66-echo -- XDG_CACHE_HOME=${HOME}/.cache }
	if { 66-echo -- XDG_CONFIG_HOME=${HOME}/.config }
	if { 66-echo -- XDG_DATA_HOME=${HOME}/.local/share }
	if { 66-echo -- XDG_DATA_DIRS=${HOME}/.local/share:/usr/local/share:/usr/share }
	66-echo -- XDG_SESSION_CLASS=user
)

module/scandir@/service@/svscan@

deleted100644 → 0
+0 −21
Original line number Original line Diff line number Diff line
[main]
@type = longrun
@version = @version@
@description = "Create and start a nested scandir for @I"
@user = ( root )
@options = ( log env )
@depends = ( setenv@@I )
@notify = 3
@timeout-up = 3000

[start]
@runas = @I
@execute =
(
s6-setsid -qb --
umask 022
execl-cmdline -s { 66-scandir ${cmd_args} -cu }
)

[environment]
cmd_args=!@VERBOSITY_LEVEL@ @NOTIFY@ @LIVE_DIR@ @USE_ENVIRONMENT@
+2 −2
Original line number Original line Diff line number Diff line
package=scandir-66serv
package=scandir
version=0.1.0
version=0.8.1
package_macro_dir=66
package_macro_dir=66
Original line number Original line Diff line number Diff line
SCRIPT_TARGET :=
SCRIPT_TARGET := module/configure/configure

MODULE_TARGET := $(shell find module/ -type f)
SERVICE_TARGET := service/scandir@
MODULE_TARGET := $(shell find module/scandir@/service -type f)
MODULE_INSTANCE_TARGET := $(shell find module/scandir@/service@ -type f)

MODULE_CONFIGURE_TARGET := module/scandir@/configure/configure