Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
liber
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
ale
liber
Commits
b73e1653
Commit
b73e1653
authored
10 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
add init script for http server
parent
6ec57e17
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
debian/changelog
+7
-0
7 additions, 0 deletions
debian/changelog
debian/liber.default
+9
-0
9 additions, 0 deletions
debian/liber.default
debian/liber.init
+70
-0
70 additions, 0 deletions
debian/liber.init
debian/liber.postinst
+31
-0
31 additions, 0 deletions
debian/liber.postinst
with
117 additions
and
0 deletions
debian/changelog
+
7
−
0
View file @
b73e1653
liber (0.1p6) unstable; urgency=medium
* Fixed issues with user input.
* Init script for the HTTP daemon.
-- ale <ale@incal.net> Sat, 07 Feb 2015 09:47:16 +0000
liber (0.1p5) unstable; urgency=low
* Built with updated Bleve and Go.
...
...
This diff is collapsed.
Click to expand it.
debian/liber.default
0 → 100644
+
9
−
0
View file @
b73e1653
# Uncomment this line to start the HTTP interface daemon.
#ENABLE_SERVER=true
# Set the address (host:port) to listen on.
#ADDR=:4040
# Directory where books are stored.
#BOOK_DIR=/var/lib/liber/books
This diff is collapsed.
Click to expand it.
debian/liber.init
0 → 100755
+
70
−
0
View file @
b73e1653
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: liber
# Required-Start: $remote_fs $time
# Required-Stop: $remote_fs $time
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ebook collection server
# Description: Ebook collection server.
### END INIT INFO
NAME
=
liber
DESC
=
"Liber"
DAEMON
=
/usr/bin/liber
PIDFILE
=
/var/run/liber.pid
ENABLE_SERVER
=
false
USER
=
liber
ADDR
=
:4040
BOOK_DIR
=
/var/lib/liber/books
DAEMON_OPTS
=
[
-r
/etc/default/
$NAME
]
&&
.
/etc/default/
$NAME
[
-x
"
$DAEMON
"
]
||
exit
0
if
[
"
$ENABLE_SERVER
"
!=
"true"
]
;
then
echo
"
$NAME
disabled, set ENABLE_SERVER=true in /etc/default/
$NAME
to enable it"
>
&2
exit
0
fi
.
/lib/lsb/init-functions
do_start
()
{
DAEMON_OPTS
=
"--http-server=
$ADDR
--book-dir=
$BOOK_DIR
$DAEMON_OPTS
"
log_daemon_msg
"Starting
$DESC
"
"
$NAME
"
start-stop-daemon
--start
--quiet
--background
\
--pidfile
$PIDFILE
--make-pidfile
--chuid
$USER
\
--exec
/bin/sh
--
-c
\
"
$DAEMON
$DAEMON_OPTS
2>&1 | logger -t liber"
log_end_msg
$?
}
do_stop
()
{
log_daemon_msg
"Stopping
$DESC
"
"
$NAME
"
start_stop_daemon
--stop
--quiet
--oknodo
\
--pidfile
$PIDFILE
--user
$USER
log_end_msg
$?
}
case
"
$1
"
in
start
)
do_start
;;
stop
)
do_stop
;;
restart
)
$0
stop
sleep
1
$0
start
;;
*
)
echo
"Usage:
$0
{start|stop|restart}"
>
&2
exit
3
;;
esac
exit
0
This diff is collapsed.
Click to expand it.
debian/liber.postinst
0 → 100755
+
31
−
0
View file @
b73e1653
#!/bin/sh
case
"
$1
"
in
configure
)
OLDVERSION
=
"
$2
"
# see below
;;
abort-upgrade|abort-remove|abort-deconfigure
)
exit
0
;;
*
)
echo
"postinst called with unknown argument
\`
$1
'"
>
&2
exit
1
;;
esac
#DEBHELPER#
adduser
--quiet
--system
--home
/var/lib/liber
--no-create-home
--ingroup
nogroup liber
for
dir
in
/var/lib/liber /var/lib/liber/books
;
do
test
-d
$dir
||
mkdir
$dir
chmod
700
$dir
chown
liber:nogroup
$dir
done
update-rc.d liber defaults
>
/dev/null
exit
0
This diff is collapsed.
Click to expand it.
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