summaryrefslogtreecommitdiffstats
path: root/spline-startup
diff options
context:
space:
mode:
Diffstat (limited to 'spline-startup')
-rwxr-xr-xspline-startup14
1 files changed, 9 insertions, 5 deletions
diff --git a/spline-startup b/spline-startup
index 2814ab0..d9af438 100755
--- a/spline-startup
+++ b/spline-startup
@@ -84,7 +84,7 @@ class SplineStartup(object):
else:
return 0
- def _run_scripts(self, user, action):
+ def _run_scripts(self, user, action, su=True):
self._pdebug("Running scripts for user '%s'" % user.pw_name)
dir = os.path.join(user.pw_dir, 'etc', 'rc.d')
@@ -95,15 +95,19 @@ class SplineStartup(object):
if not os.path.isdir(dir):
return True
- returnvalue = self._call(['su', '-', user.pw_name,
- '-c', 'run-parts %s -- %s' %
- (' '.join(args), quote(dir))])
+ if su:
+ returnvalue = self._call(['su', '-', user.pw_name,
+ '-c', 'run-parts %s -- %s' %
+ (' '.join(args), quote(dir))])
+ else:
+ returnvalue = self._call(['run-parts'] + args + ['--', dir])
+
return returnvalue == 0
def run(self):
if not is_root():
user = pwd.getpwuid(os.getuid())
- self._run_scripts(user, self.options.action)
+ self._run_scripts(user, self.options.action, False)
return
if self.options.user is not None: