/[pxelator]/lib/PXElator/screen.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /lib/PXElator/screen.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 49 - (hide annotations)
Thu Jul 30 00:08:21 2009 UTC (12 years, 2 months ago) by dpavlin
File size: 866 byte(s)
replacement for bin/start-split.sh

1 dpavlin 49 package screen;
2    
3     use warnings;
4     use strict;
5     use autodie;
6    
7     use File::Slurp;
8    
9     use log;
10     use server;
11    
12     my $screenrc = '/tmp/screenrc';
13    
14     sub screen_daemon {
15     my $daemon = shift;
16     my $run = "sudo perl -I$server::base_dir/lib/PXElator -I$server::base_dir/lib -M$daemon -e " . $daemon . "::start";
17     warn "# $daemon $run\n";
18     qq|
19    
20     split
21    
22     screen -t $daemon $run
23     logfile $log::dir/pxelator.$daemon.log
24     log on
25    
26     focus down
27     |}
28    
29     write_file $screenrc, qq|
30    
31     autodetach off
32     altscreen off
33     defscrollback 10000
34     startup_message off
35    
36     sessionname PXElator
37    
38     |
39     . screen_daemon('dhcpd')
40     . screen_daemon('tftpd')
41     . screen_daemon('httpd')
42     . qq|remove|;
43     ;
44    
45     print "screenrc $screenrc ", -s $screenrc;
46    
47     sub start {
48    
49     my $screen="screen -R PXElator -c $screenrc";
50     warn $screen;
51    
52     chdir $server::base_dir;
53    
54     if ( defined $ENV{DISPLAY} ) {
55     exec "xterm -e $screen";
56     } else {
57     exec $screen;
58     }
59    
60     }
61    
62     1;

  ViewVC Help
Powered by ViewVC 1.1.26