Last active
December 20, 2015 17:48
-
-
Save sng2c/6170751 to your computer and use it in GitHub Desktop.
Create 'autostart' directory on a directory which startall.pl is on.
Each app directory must have start.sh and put or link the app directory in autostart directory.
If you launch startall.pl, all of the start.sh scripts are running within each 'screen' processes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# An example of start.sh | |
./app_pkg.pl daemon -l 'http://localhost:50005' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use File::pushd; | |
my @apps = <autostart/*>; | |
foreach my $d (@apps){ | |
my $dir = pushd($d); | |
$d =~ m@([^/]+)$@; | |
my $name = $1; | |
my $res = system("screen -dmS '$name' ./start.sh"); | |
print "$name - $res\n"; | |
} | |
sleep(1); | |
system("screen -list"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
my @apps = <autostart/*>; | |
foreach my $d (@apps){ | |
$d =~ m@([^/]+)$@; | |
my $name = $1; | |
system("screen -S '$name' -X quit"); | |
} | |
system("screen -list"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment