Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
liber
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ale
liber
Commits
bd8eccf0
Commit
bd8eccf0
authored
Feb 08, 2015
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add init script for http server
parent
ac1f6432
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
0 deletions
+117
-0
debian/changelog
debian/changelog
+7
-0
debian/liber.default
debian/liber.default
+9
-0
debian/liber.init
debian/liber.init
+70
-0
debian/liber.postinst
debian/liber.postinst
+31
-0
No files found.
debian/changelog
View file @
bd8eccf0
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.
...
...
debian/liber.default
0 → 100644
View file @
bd8eccf0
# 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
debian/liber.init
0 → 100755
View file @
bd8eccf0
#!/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
debian/liber.postinst
0 → 100755
View file @
bd8eccf0
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment