@@ -122,21 +122,14 @@ if __name__ == '__main__':
122
122
debug ('pidfile (%s) is not writable: %s' % (options .pidfile , e ))
123
123
sys .exit (- 1 )
124
124
debug ('Bot not found, starting.' )
125
- home = os .environ ['HOME' ]
126
- inst = subprocess .Popen ('sh' , close_fds = True , stderr = subprocess .STDOUT ,
127
- stdin = subprocess .PIPE , stdout = subprocess .PIPE )
128
- for filename in ('.login' , '.bash_profile' , '.profile' , '.bashrc' ):
129
- filename = os .path .join (home , filename )
130
- if os .path .exists (filename ):
131
- debug ('Found %s, sourcing.' % filename )
132
- inst .stdin .write ('source %s' % filename + os .linesep )
133
- cmdline = '%s --daemon %s' % (options .supybot , options .conffile )
134
- debug ('Sending cmdline to sh process.' )
135
- inst .stdin .write (cmdline + os .linesep )
136
- inst .stdin .close ()
137
- debug ('Received from sh process: %r' % inst .stdout .read ())
125
+ cmdline = [options .supybot , '--daemon' , options .conffile ]
126
+ inst = subprocess .Popen (cmdline , close_fds = True ,
127
+ stderr = subprocess .STDOUT ,
128
+ stdin = None , stdout = subprocess .PIPE )
129
+ debug ('Output from supybot: %r' % inst .stdout .read ())
138
130
ret = inst .wait ()
139
- debug ('Bot started, command line %r returned %s.' % (cmdline , ret ))
131
+ debug ('Bot started, command line %r returned %s.' % (' ' .join (cmdline ),
132
+ ret ))
140
133
sys .exit (ret )
141
134
else :
142
135
sys .exit (0 )
0 commit comments