Skip to content

Commit

Permalink
make init script work with just defaults, without a conf file
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed May 27, 2011
1 parent 9a0e43b commit e7fc9a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions starmachine_init.d
Expand Up @@ -58,15 +58,15 @@ my ( $conf_file ) = grep -r, (
catfile( $starmachine_root, 'starmachine.conf' ),
'/etc/starmachine.conf',
);
$conf_file or die "conf file not found, or not readable.\n";
my $all_conf = read_config_file( $conf_file );
my $all_conf = $conf_file ? read_config_file( $conf_file ) : {};

my $app = basename $0;

my %conf = (
#defaults
port => 8080,
user => 'www-data',
user => $<,
group => ( split /\s+/, $( )[0],
workers => 10,
timeout => 20,
preload_app => 1,
Expand Down Expand Up @@ -110,7 +110,8 @@ chdir $app_dir or die "cannot chdir to $app_dir, aborting.\n";
open( STDIN, '<&DATA' ) or die;
exec '/bin/sh', '-s', @ARGV;
__DATA__
# based on site-init.sh script by Mischa Spiegelmock at

# based loosely on site-init.sh script by Mischa Spiegelmock at
# http://wiki.catalystframework.org/wiki/deployment/perlbal-starman-psgi

. /lib/lsb/init-functions
Expand Down

0 comments on commit e7fc9a8

Please sign in to comment.