[Xenomai-git] Jan Kiszka : Add multi-user service setup scripts

2015-01-19 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 001443054e1ff119d4e3985ae99d8107b45e1470
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=001443054e1ff119d4e3985ae99d8107b45e1470

Author: Jan Kiszka 
Date:   Thu Jan  8 17:08:46 2015 +0100

Add multi-user service setup scripts

This script can be hooked up with the system in order to allow
unprivileged members of the xenomai group to access real-time services
as well. It configures the module parameter, creates the registry root
directory with the appropriate access rights and ensures that a sysreg
daemon for the anon session is running.

Signed-off-by: Jan Kiszka 

---

 scripts/xeno-multiuser |   91 
 1 file changed, 91 insertions(+)

diff --git a/scripts/xeno-multiuser b/scripts/xeno-multiuser
new file mode 100755
index 000..5f4d380
--- /dev/null
+++ b/scripts/xeno-multiuser
@@ -0,0 +1,91 @@
+#! /bin/sh
+#
+# Copyright (C) 2015 Siemens AG
+#
+# Authors:
+#  Jan Kiszka 
+#
+# Released under the terms of the GPLv2.
+#
+
+### BEGIN INIT INFO
+# Provides:  xeno-multiuser
+# Required-Start:$syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: Xenomai multi-user setup
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Xenomai multi-user setup"
+NAME=xenomai
+DAEMON=/usr/sbin/sysregd
+DAEMON_ARGS="--linger --shared"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+SYSREG_ROOT=/var/run/xenomai
+XENOMAI_GROUP=xenomai
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+. /lib/lsb/init-functions
+
+do_start()
+{
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && return 0
+
+   echo `getent group $XENOMAI_GROUP | cut -d: -f3` > 
/sys/module/xenomai/parameters/allowed_group
+
+   mkdir -p $SYSREG_ROOT
+   chgrp $XENOMAI_GROUP $SYSREG_ROOT
+   chmod g+rwxs $SYSREG_ROOT
+
+   sg $XENOMAI_GROUP -c "
+   $DAEMON $DAEMON_ARGS --root=$SYSREG_ROOT/anon &
+   [ \$? == 0 ] || return 1;
+   echo \$! > $PIDFILE
+   "
+   return $?
+}
+
+do_stop()
+{
+   killproc -p $PIDFILE $DAEMON
+   RETVAL="$?"
+   rm -f $PIDFILE
+   # Clean up mountpoint root dir
+   rm -rf $SYSREG_ROOT
+
+   [ "$RETVAL" == 0 ] || return 1
+   return 0
+}
+
+case "$1" in
+  start)
+   do_start
+   ;;
+  stop)
+   do_stop
+   ;;
+  status)
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && exit 0 || exit $?
+   ;;
+  restart|force-reload)
+   do_stop
+   case "$?" in
+ 0|1)
+   do_start
+   ;;
+ *)
+   # Failed to stop
+   ;;
+   esac
+   ;;
+  *)
+   echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+   exit 3
+   ;;
+esac


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Jan Kiszka : Add multi-user service setup scripts

2015-01-14 Thread git repository hosting
Module: xenomai-jki
Branch: for-forge
Commit: 71c5da95f71665f60fdc2a65c2dc3633c488ae42
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=71c5da95f71665f60fdc2a65c2dc3633c488ae42

Author: Jan Kiszka 
Date:   Thu Jan  8 17:08:46 2015 +0100

Add multi-user service setup scripts

This script can be hooked up with the system in order to allow
unprivileged members of the xenomai group to access real-time services
as well. It configures the module parameter, creates the registry root
directory with the appropriate access rights and ensures that a sysreg
daemon for the anon session is running.

Signed-off-by: Jan Kiszka 

---

 scripts/xeno-multiuser |   91 
 1 file changed, 91 insertions(+)

diff --git a/scripts/xeno-multiuser b/scripts/xeno-multiuser
new file mode 100755
index 000..5f4d380
--- /dev/null
+++ b/scripts/xeno-multiuser
@@ -0,0 +1,91 @@
+#! /bin/sh
+#
+# Copyright (C) 2015 Siemens AG
+#
+# Authors:
+#  Jan Kiszka 
+#
+# Released under the terms of the GPLv2.
+#
+
+### BEGIN INIT INFO
+# Provides:  xeno-multiuser
+# Required-Start:$syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: Xenomai multi-user setup
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Xenomai multi-user setup"
+NAME=xenomai
+DAEMON=/usr/sbin/sysregd
+DAEMON_ARGS="--linger --shared"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+SYSREG_ROOT=/var/run/xenomai
+XENOMAI_GROUP=xenomai
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+. /lib/lsb/init-functions
+
+do_start()
+{
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && return 0
+
+   echo `getent group $XENOMAI_GROUP | cut -d: -f3` > 
/sys/module/xenomai/parameters/allowed_group
+
+   mkdir -p $SYSREG_ROOT
+   chgrp $XENOMAI_GROUP $SYSREG_ROOT
+   chmod g+rwxs $SYSREG_ROOT
+
+   sg $XENOMAI_GROUP -c "
+   $DAEMON $DAEMON_ARGS --root=$SYSREG_ROOT/anon &
+   [ \$? == 0 ] || return 1;
+   echo \$! > $PIDFILE
+   "
+   return $?
+}
+
+do_stop()
+{
+   killproc -p $PIDFILE $DAEMON
+   RETVAL="$?"
+   rm -f $PIDFILE
+   # Clean up mountpoint root dir
+   rm -rf $SYSREG_ROOT
+
+   [ "$RETVAL" == 0 ] || return 1
+   return 0
+}
+
+case "$1" in
+  start)
+   do_start
+   ;;
+  stop)
+   do_stop
+   ;;
+  status)
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && exit 0 || exit $?
+   ;;
+  restart|force-reload)
+   do_stop
+   case "$?" in
+ 0|1)
+   do_start
+   ;;
+ *)
+   # Failed to stop
+   ;;
+   esac
+   ;;
+  *)
+   echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+   exit 3
+   ;;
+esac


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Jan Kiszka : Add multi-user service setup scripts

2015-01-12 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: e663a2d6b475a1617d519f16751916361c2d0be2
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e663a2d6b475a1617d519f16751916361c2d0be2

Author: Jan Kiszka 
Date:   Thu Jan  8 17:08:46 2015 +0100

Add multi-user service setup scripts

This script can be hooked up with the system in order to allow
unprivileged members of the xenomai group to access real-time services
as well. It configures the module parameter, creates the registry root
directory with the appropriate access rights and ensures that a sysreg
daemon for the anon session is running.

Signed-off-by: Jan Kiszka 

---

 scripts/xeno-multiuser |   88 
 1 file changed, 88 insertions(+)

diff --git a/scripts/xeno-multiuser b/scripts/xeno-multiuser
new file mode 100755
index 000..0025871
--- /dev/null
+++ b/scripts/xeno-multiuser
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+# Copyright (C) 2015 Siemens AG
+#
+# Authors:
+#  Jan Kiszka 
+#
+# Released under the terms of the GPLv2.
+#
+
+### BEGIN INIT INFO
+# Provides:  xeno-multiuser
+# Required-Start:$syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: Xenomai multi-user setup
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Xenomai multi-user setup"
+NAME=xenomai
+DAEMON=/usr/sbin/sysregd
+DAEMON_ARGS="--linger --shared"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+SYSREG_ROOT=/var/run/xenomai
+XENOMAI_GROUP=xenomai
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+. /lib/lsb/init-functions
+
+do_start()
+{
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && return 0
+
+   echo `getent group $XENOMAI_GROUP | cut -d: -f3` > 
/sys/module/xenomai/parameters/allowed_group
+
+   mkdir -p $SYSREG_ROOT
+   chgrp $XENOMAI_GROUP $SYSREG_ROOT
+   chmod g+rwxs $SYSREG_ROOT
+
+   $DAEMON $DAEMON_ARGS --root=$SYSREG_ROOT/anon &
+   [ "$?" == 0 ] || return 1
+   echo "$!" > $PIDFILE
+}
+
+do_stop()
+{
+   killproc -p $PIDFILE $DAEMON
+   RETVAL="$?"
+   rm -f $PIDFILE
+   # Clean up mountpoint root dir
+   rm -rf $SYSREG_ROOT
+
+   [ "$RETVAL" == 0 ] || return 1
+   return 0
+}
+
+case "$1" in
+  start)
+   do_start
+   ;;
+  stop)
+   do_stop
+   ;;
+  status)
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && exit 0 || exit $?
+   ;;
+  restart|force-reload)
+   do_stop
+   case "$?" in
+ 0|1)
+   do_start
+   ;;
+ *)
+   # Failed to stop
+   ;;
+   esac
+   ;;
+  *)
+   echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+   exit 3
+   ;;
+esac


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Jan Kiszka : Add multi-user service setup scripts

2015-01-08 Thread git repository hosting
Module: xenomai-jki
Branch: for-forge
Commit: f5ecf8b926f25cd6a174963ac026994b0fdd2947
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=f5ecf8b926f25cd6a174963ac026994b0fdd2947

Author: Jan Kiszka 
Date:   Thu Jan  8 17:08:46 2015 +0100

Add multi-user service setup scripts

This script can be hooked up with the system in order to allow
unprivileged members of the xenomai group to access real-time services
as well. It configures the module parameter, creates the registry root
directory with the appropriate access rights and ensures that a sysreg
daemon for the anon session is running.

Signed-off-by: Jan Kiszka 

---

 scripts/xeno-multiuser |   88 
 1 file changed, 88 insertions(+)

diff --git a/scripts/xeno-multiuser b/scripts/xeno-multiuser
new file mode 100755
index 000..0025871
--- /dev/null
+++ b/scripts/xeno-multiuser
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+# Copyright (C) 2015 Siemens AG
+#
+# Authors:
+#  Jan Kiszka 
+#
+# Released under the terms of the GPLv2.
+#
+
+### BEGIN INIT INFO
+# Provides:  xeno-multiuser
+# Required-Start:$syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop:  0 1 6
+# Short-Description: Xenomai multi-user setup
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Xenomai multi-user setup"
+NAME=xenomai
+DAEMON=/usr/sbin/sysregd
+DAEMON_ARGS="--linger --shared"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+SYSREG_ROOT=/var/run/xenomai
+XENOMAI_GROUP=xenomai
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+. /lib/lsb/init-functions
+
+do_start()
+{
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && return 0
+
+   echo `getent group $XENOMAI_GROUP | cut -d: -f3` > 
/sys/module/xenomai/parameters/allowed_group
+
+   mkdir -p $SYSREG_ROOT
+   chgrp $XENOMAI_GROUP $SYSREG_ROOT
+   chmod g+rwxs $SYSREG_ROOT
+
+   $DAEMON $DAEMON_ARGS --root=$SYSREG_ROOT/anon &
+   [ "$?" == 0 ] || return 1
+   echo "$!" > $PIDFILE
+}
+
+do_stop()
+{
+   killproc -p $PIDFILE $DAEMON
+   RETVAL="$?"
+   rm -f $PIDFILE
+   # Clean up mountpoint root dir
+   rm -rf $SYSREG_ROOT
+
+   [ "$RETVAL" == 0 ] || return 1
+   return 0
+}
+
+case "$1" in
+  start)
+   do_start
+   ;;
+  stop)
+   do_stop
+   ;;
+  status)
+   pidofproc -p $PIDFILE "$DAEMON" >/dev/null && exit 0 || exit $?
+   ;;
+  restart|force-reload)
+   do_stop
+   case "$?" in
+ 0|1)
+   do_start
+   ;;
+ *)
+   # Failed to stop
+   ;;
+   esac
+   ;;
+  *)
+   echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+   exit 3
+   ;;
+esac


___
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git