-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #498 from rbreaves/dev
Add support for sysvinit & mxlinux w/ xfce
- Loading branch information
Showing
7 changed files
with
354 additions
and
118 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
# | ||
# chkconfig: 35 90 12 | ||
# description: Kinto service | ||
# | ||
|
||
# Get function from functions library | ||
# . /etc/init.d/functions | ||
|
||
# Start the service | ||
start() { | ||
echo -n "Starting Kinto (xkeynsail)" | logger | ||
xkeycount=$(pgrep 'xkeysnail' | wc -l) | ||
|
||
if [[ $xkeycount -eq 0 ]]; then | ||
/usr/bin/xhost +SI:localuser:root && script -q -c "xkeysnail --quiet --watch `echo $HOME`/.config/kinto/kinto.py" /dev/null | tee -a /tmp/kinto.log & | ||
### Create the lock file ### | ||
touch /var/lock/subsys/kinto | ||
success $"Kinto (xkeynsail) started" | ||
else | ||
echo "Kinto (xkeynsail) service is already running." | ||
fi | ||
|
||
echo | ||
} | ||
|
||
# Restart the service | ||
stop() { | ||
echo -n "Stopping Kinto (xkeynsail)" | logger | ||
sudo pkill -f bin/xkeysnail >/dev/null 2>&1 | ||
### Now, delete the lock file ### | ||
rm -f /var/lock/subsys/kinto | ||
echo | ||
} | ||
|
||
### main logic ### | ||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
status) | ||
status | ||
;; | ||
restart|reload|condrestart) | ||
stop | ||
sleep 5 | ||
start | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|restart|reload|status}" | ||
exit 1 | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# /etc/sudoers.d/limitedadmins | ||
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11/bin" | ||
Defaults!/etc/init.d/kinto setenv,env_reset,env_delete+=PATH,env_delete+=LD_PRELOAD,env_delete+=LD_LIBRARY_PATH,env_delete+=SSH_AUTH_SOCK,env_delete+=PYTHONPATH,env_delete+=PERL5LIB | ||
%{username} ALL=NOPASSWD: /etc/init.d/kinto * | ||
%{username} ALL=NOPASSWD: {systemctl} restart xkeysnail | ||
%{username} ALL=NOPASSWD: {systemctl} start xkeysnail | ||
%{username} ALL=NOPASSWD: {systemctl} stop xkeysnail | ||
%{username} ALL=NOPASSWD: {systemctl} status xkeysnail | ||
%{username} ALL=(root) NOPASSWD: /usr/local/bin/logoff.sh | ||
%{username} ALL=NOPASSWD: {pkill} -f logoff | ||
%{username} ALL=NOPASSWD: {pkill} -f bin/xkeysnail | ||
%{username} ALL=NOPASSWD: {xkeysnail} /home/{username}/.config/kinto/kinto.py | ||
%{username} ALL=NOPASSWD: {xkeysnail} * | ||
%{username} ALL=NOPASSWD: {systemctl} is-active --quiet xkeysnail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[Desktop Entry] | ||
Name=Kinto_xkey | ||
GenericName=Kinto_xkey | ||
Comment=Make Linux Type Like it's a Mac | ||
Exec=/bin/bash -c "grep -q 'autostart = true' {homedir}/.config/kinto/kinto.py && sudo -E /etc/init.d/kinto restart" | ||
Terminal=false | ||
Type=Application | ||
X-GNOME-Autostart-enabled=true |
Oops, something went wrong.