Skip to content

Commit

Permalink
fix run-part's environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Liraz Siri committed May 14, 2010
1 parent 332c968 commit 68052c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ebsmount.py
Expand Up @@ -3,6 +3,8 @@
import os
from os.path import *

import pwd

import udevdb
from executil import system
from utils import config, log, is_mounted, mount
Expand Down Expand Up @@ -38,7 +40,8 @@ def ebsmount_add(devname, mountdir):
log(devname, "mounted %s %s (%s)" % (devpath, mountpath, mountoptions))

if exists(scriptpath):
cmd = "run-parts --verbose %s" % scriptpath
os.environ['HOME'] = pwd.getpwuid(os.getuid()).pw_dir
cmd = "/bin/bash --login -c 'export PATH; run-parts --verbose %s'" % scriptpath
cmd += " 2>&1 | tee -a %s" % config.logfile
system(cmd)

Expand Down

0 comments on commit 68052c0

Please sign in to comment.