Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
boot-user
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
66-service
Arch
boot-user
Commits
312eebfe
Commit
312eebfe
authored
4 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
Bump v0.3.0
parent
23d0b3c2
No related branches found
No related tags found
No related merge requests found
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/66-mods.sh
+0
-109
0 additions, 109 deletions
scripts/66-mods.sh
service/boot-user@
+38
-0
38 additions, 0 deletions
service/boot-user@
tools/install.sh
+64
-0
64 additions, 0 deletions
tools/install.sh
with
102 additions
and
109 deletions
scripts/66-mods.sh
deleted
100755 → 0
+
0
−
109
View file @
23d0b3c2
#!/usr/bin/bash
# Copyright (c) 2015-2019 Eric Vidal <eric@obarun.org>
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
PROG
=
"66-mods.sh"
service_system
=
"
${
service_system
:-
/usr/lib/66/service
}
"
module_system
=
"
${
module_system
:-
/usr/lib/66/module
}
"
force
=
0
out
()
{
msg
=
"
${
1
}
"
66-echo
--
$PROG
:
$msg
}
die
()
{
out
"
${
1
}
"
exit
111
}
usage
()
{
cat
<<
EOF
$PROG
[ -h ] [ -H ] [ -f ] module@instance
$PROG
<options> modules@instance
options :
-h: print this help
-H: print module help
-f: force to overwrite an existing module
EOF
exit
0
}
for
arg
;
do
case
"
$arg
"
in
-h
|
--help
)
usage
;;
-H
|
--help-module
)
hm
=
1
;;
-f
|
--force
)
force
=
1
;;
-
*
)
die
"fatal: unknown option
$arg
"
;;
*
)
target+
=(
$arg
)
;;
esac
done
if
[[
"
${
target
[0]
}
"
!=
*
"@"
*
]]
;
then
die
"fatal: invalid argument -- not a module name"
fi
mod
=
"
${
target
[0]
}
"
mod
=
"
${
mod
%%@*
}
"
mod
=
"
${
mod
%%@*
}
@"
insta
=
"
${
target
[0]
}
"
insta
=
"
${
insta
##*@
}
"
service
=
"
${
mod
}${
insta
}
"
if
[[
!
-d
${
module_system
}
/
${
mod
}
]]
;
then
die
"fatal: module
${
mod
}
doesn't exist"
fi
if
((
${
hm
}
))
;
then
if
[[
-e
${
module_system
}
/
${
mod
}
/.configure/help
]]
;
then
h
=
$(
<
${
module_system
}
/
${
mod
}
/.configure/help
)
66-echo
--
"
${
h
}
"
else
out
"warning: no help found for
${
mod
}
"
fi
exit
0
fi
if
[[
-z
"
${
insta
}
"
]]
;
then
die
"fatal: instance for
${
mod
}
is not set"
fi
if
[[
-d
${
service_system
}
/
${
service
}
]]
;
then
if
((
!
$force
))
;
then
die
"fatal:
${
service_system
}
/
${
service
}
already exist"
else
rm
-rf
${
service_system
}
/
${
service
}
||
die
"fatal: unable to remove
${
service_system
}
/
${
service
}
"
fi
fi
cp
-rT
${
module_system
}
/
${
mod
}
${
service_system
}
/
${
service
}
||
die
"fatal: unable to cp
${
module_system
}
/
${
mod
}
to
${
service_system
}
/
${
service
}
"
## @I in file
for
i
in
$(
find
${
service_system
}
/
${
service
}
-mindepth
1
-type
f
)
;
do
sed
-i
"s:@I:
${
insta
}
:g"
$i
||
die
"fatal: unable to sed
${
i
}
"
done
## change directory name
for
i
in
$(
find
${
service_system
}
/
${
service
}
-mindepth
1
-type
d|grep
-v
"configure"
)
;
do
mv
$i
$(
66-echo
--
${
i
}
|sed
"s:@M:
${
insta
}
:g"
)
||
die
"fatal: unable to move
${
i
}
to
$(
echo
${
i
}
|sed
"s:@M:
${
insta
}
:g"
)
"
done
## change file name
for
i
in
$(
find
${
service_system
}
/
${
service
}
-mindepth
1
-type
f|grep
-v
"configure"
)
;
do
mv
$i
$(
66-echo
--
${
i
}
|sed
"s:@M:
${
insta
}
:g"
)
||
die
"fatal: unable to move
${
i
}
to
$(
echo
${
i
}
|sed
"s:@M:
${
insta
}
:g"
)
"
done
## run .configure scripts
if
[[
-x
${
service_system
}
/
${
service
}
/.configure/configure
]]
;
then
cd
${
service_system
}
/
${
service
}
/.configure/
${
service_system
}
/
${
service
}
/.configure/configure
${
insta
}
||
die
"fatal: unable to configure
${
service_system
}
/
${
service
}
"
rm
-rf
${
service_system
}
/
${
service
}
/.configure
||
die
"fatal: unable to remove
${
service_system
}
/
${
service
}
/.configure"
fi
This diff is collapsed.
Click to expand it.
service/boot-user@
0 → 100644
+
38
−
0
View file @
312eebfe
[main]
@type = module
@version = @VERSION@
@description = "Configure a nested supervision tree for @I user"
@user = ( root )
@options = ( env )
@depends = ( scandir@@I )
[regex]
@configure = "@I"
@infiles = ( ::@version@=@VERSION@ )
[environment]
## Uncomment it to use a display manager.
## Can be any display manager as long as the
## corresponding frontend file exist on your system
## e.g sddm,lightdm,...
## It also prepare the .xsession file.
@DISPLAY_MANAGER@
## Uncomment it to use a console tracker.
## Can be any console tracker as long as the
## corresponding frontend file exist on your system
## e.g consolekit,elogind,...
@CONSOLE_TRACKER@
## Create and mount the XDG_RUNTIME directory
## at /run/user/@I [yes|no]
@XDG_RUNTIME@
## Command to use in your .xinitrc
## to launch your desktop e.g.: openbox-session.
## If commented the .xinitrc file is not configured.
@DESKTOP_CMDLINE@
This diff is collapsed.
Click to expand it.
tools/install.sh
0 → 100755
+
64
−
0
View file @
312eebfe
#!/bin/sh
usage
()
{
echo
"usage:
$0
[-D] [-l] [-m mode] src dst"
1>&2
exit
1
}
mkdirp
=
false
symlink
=
false
mode
=
0755
while
getopts
Dlm: name
;
do
case
"
$name
"
in
D
)
mkdirp
=
true
;;
l
)
symlink
=
true
;;
m
)
mode
=
$OPTARG
;;
?
)
usage
;;
esac
done
shift
$((
$OPTIND
-
1
))
test
"$#"
-eq
2
||
usage
src
=
$1
dst
=
$2
tmp
=
"
$dst
.tmp.
$$
"
case
"
$dst
"
in
*
/
)
echo
"
$0
:
$dst
ends in /"
1>&2
;
exit
1
;;
esac
set
-C
set
-e
if
$mkdirp
;
then
umask
022
case
"
$2
"
in
*
/
*
)
mkdir
-p
"
${
dst
%/*
}
"
;;
esac
fi
trap
'rm -f "$tmp"'
EXIT INT QUIT TERM HUP
umask
077
if
$symlink
;
then
ln
-s
"
$src
"
"
$tmp
"
else
cat
<
"
$1
"
>
"
$tmp
"
chmod
"
$mode
"
"
$tmp
"
fi
mv
-f
"
$tmp
"
"
$dst
"
if
test
-d
"
$dst
"
;
then
rm
-f
"
$dst
/
$(
basename
$tmp
)
"
if
$symlink
;
then
mkdir
"
$tmp
"
ln
-s
"
$src
"
"
$tmp
/
$(
basename
$dst
)
"
mv
-f
"
$tmp
/
$(
basename
$dst
)
"
"
${
dst
%/*
}
"
rmdir
"
$tmp
"
else
echo
"
$0
:
$dst
is a directory"
1>&2
exit
1
fi
fi
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment