summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-02-05 11:16:28 +0000
committerdamien <damien@mandriva.com>2002-02-05 11:16:28 +0000
commit859a067abb489e4c943a859e122ed53ef02a3455 (patch)
tree7a461fd282820e351d738ce4fab7e3834eab0346 /perl-install/standalone
parenteac90b093b39b651b4f91da31dc9f4b37ef6d88d (diff)
downloaddrakx-859a067abb489e4c943a859e122ed53ef02a3455.tar
drakx-859a067abb489e4c943a859e122ed53ef02a3455.tar.gz
drakx-859a067abb489e4c943a859e122ed53ef02a3455.tar.bz2
drakx-859a067abb489e4c943a859e122ed53ef02a3455.tar.xz
drakx-859a067abb489e4c943a859e122ed53ef02a3455.zip
correction for mcc.
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/logdrake46
1 files changed, 27 insertions, 19 deletions
diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake
index 066393bc1..aae903c17 100755
--- a/perl-install/standalone/logdrake
+++ b/perl-install/standalone/logdrake
@@ -41,14 +41,18 @@ use Data::Dumper;
# (This version is now UTF8 compliant - Sg 2001-08-18)
#-------------------------------------------------------------
-sub _ {
- my $s = shift @_; my $t = translate($s);
- sprintf $t, @_;
-}
+{
+ no warnings;
+ sub _ {
+ my $s = shift @_; my $t = translate($s);
+ sprintf $t, @_;
+ }
-sub translate {
- my ($s) = @_;
- $s ? c::dgettext('drakconf', $s) : '';
+ no warnings;
+ sub translate {
+ my ($s) = @_;
+ $s ? c::dgettext('drakconf', $s) : '';
+ }
}
$::isInstall and die "Not supported during install.\n";
@@ -173,12 +177,13 @@ my %files = (
);
my $yy=gtkset_sensitive(gtksignal_connect(new Gtk::Button(_("search")) , clicked => \&search),0);
+my $log_text = new Gtk::Text(undef, undef);
my $refcount_search;
#### far from window
gtkadd($window,
gtkpack_(new Gtk::VBox(0,5),
- 0, _("A tool to monitor your logs"),
- if_ (!$::isFile, 0, gtkadd(new Gtk::Frame(_("Settings")),
+ if_(!$::isExplain, 0, _("A tool to monitor your logs")),
+ if_(!$::isFile, 0, gtkadd(new Gtk::Frame(_("Settings")),
gtkpack__(new Gtk::VBox(0,2),
gtkpack__(new Gtk::VBox(0,2),
# _("Show lines"),
@@ -202,17 +207,17 @@ gtkadd($window,
$yy,
)
)
- ),
- 1, gtkadd(new Gtk::Frame(_("Content of the file")),
- createScrolledWindow(my $log_text = new Gtk::Text(undef, undef))
- ),
- 0, gtkadd (gtkset_layout(new Gtk::HButtonBox,-end),
+ ),
+ !$::isExplain ? (1, gtkadd(new Gtk::Frame(_("Content of the file")),
+ createScrolledWindow($log_text)
+ )) : (1, $log_text),
+ if_(!$::isExplain, 0, gtkadd (gtkset_layout(new Gtk::HButtonBox,-end),
if_ (!$::isFile, gtksignal_connect(new Gtk::Button (_("Mail/SMS alert")), clicked => \&alert_config)),
gtksignal_connect(new Gtk::Button (_("Save")), clicked => \&save),
gtksignal_connect(new Gtk::Button ($::isEmbedded ? _("Cancel") : _("Quit")), clicked => \&quit)
)
-
- )
+ )
+ )
);
@@ -220,8 +225,8 @@ $::isFile and gtkset_usize($log_text,400,500);
$window->realize;
$window->show_all();
search() if ($::isFile);
-Gtk->main_iteration while Gtk->events_pending;
-$::isEmbedded and kill 'USR2', $::CCPID;
+#Gtk->main_iteration while Gtk->events_pending;
+#$::isEmbedded and kill 'USR2', $::CCPID;
Gtk->main;
sub quit {
@@ -276,7 +281,7 @@ sub parse_file {
while (@all) {
$t = pop @all;
next if ($t =~ /logdrake/);
- last if !($t =~ /$Explain/);
+ last if !($t =~ /$::Explain/);
push @t, $t;
}
@all=reverse @t;
@@ -511,6 +516,9 @@ sub destroy_window {
# log
# $Log$
+# Revision 1.10 2002/02/05 11:16:28 damien
+# correction for mcc.
+#
# Revision 1.9 2002/02/04 14:02:14 damien
# corrected typo. Yvounet, check your code!!
#
a> 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
package services; # $Id: services.pm 267089 2010-03-28 12:51:44Z tv $




#-######################################################################################
#- misc imports
#-######################################################################################

use strict;
use common;
use run_program;

use File::Basename;

sub description {
    my %services = (
acpid => N_("Listen and dispatch ACPI events from the kernel"),	    
alsa => N_("Launch the ALSA (Advanced Linux Sound Architecture) sound system"),
anacron => N_("Anacron is a periodic command scheduler."),
apmd => N_("apmd is used for monitoring battery status and logging it via syslog.
It can also be used for shutting down the machine when the battery is low."),
atd => N_("Runs commands scheduled by the at command at the time specified when
at was run, and runs batch commands when the load average is low enough."),
'avahi-deamon' => N_("Avahi is a ZeroConf daemon which implements an mDNS stack"),
cpufreq => N_("Set CPU frequency settings"),
crond => N_("cron is a standard UNIX program that runs user-specified programs
at periodic scheduled times. vixie cron adds a number of features to the basic
UNIX cron, including better security and more powerful configuration options."),
cups => N_("Common UNIX Printing System (CUPS) is an advanced printer spooling system"),
dm => N_("Launches the graphical display manager"),
fam => N_("FAM is a file monitoring daemon. It is used to get reports when files change.
It is used by GNOME and KDE"),
g15daemon => N_("G15Daemon allows users access to all extra keys by decoding them and 
pushing them back into the kernel via the linux UINPUT driver. This driver must be loaded 
before g15daemon can be used for keyboard access. The G15 LCD is also supported. By default, 
with no other clients active, g15daemon will display a clock. Client applications and 
scripts can access the LCD via a simple API."),
gpm => N_("GPM adds mouse support to text-based Linux applications such the
Midnight Commander. It also allows mouse-based console cut-and-paste operations,
and includes support for pop-up menus on the console."),
haldaemon => N_("HAL is a daemon that collects and maintains information about hardware"),
harddrake => N_("HardDrake runs a hardware probe, and optionally configures
new/changed hardware."),
httpd => N_("Apache is a World Wide Web server. It is used to serve HTML files and CGI."),
inet => N_("The internet superserver daemon (commonly called inetd) starts a
variety of other internet services as needed. It is responsible for starting
many services, including telnet, ftp, rsh, and rlogin. Disabling inetd disables
all of the services it is responsible for."),
ip6tables => N_("Automates a packet filtering firewall with ip6tables"),
iptables => N_("Automates a packet filtering firewall with iptables"),
irqbalance => N_("Evenly distributes IRQ load across multiple CPUs for enhanced performance"),
keytable => N_("This package loads the selected keyboard map as set in
/etc/sysconfig/keyboard.  This can be selected using the kbdconfig utility.
You should leave this enabled for most machines."),
kheader => N_("Automatic regeneration of kernel header in /boot for
/usr/include/linux/{autoconf,version}.h"),
kudzu => N_("Automatic detection and configuration of hardware at boot."),
'laptop-mode' => N_("Tweaks system behavior to extend battery life"),
linuxconf => N_("Linuxconf will sometimes arrange to perform various tasks
at boot-time to maintain the system configuration."),
lpd => N_("lpd is the print daemon required for lpr to work properly. It is
basically a server that arbitrates print jobs to printer(s)."),
lvs => N_("Linux Virtual Server, used to build a high-performance and highly
available server."),
mandi => N_("Monitors the network (Interactive Firewall and wireless"),
mdadm => N_("Software RAID monitoring and management"),
messagebus => N_("DBUS is a daemon which broadcasts notifications of system events and other messages"),
msec => N_("Enables MSEC security policy on system startup"),
named => N_("named (BIND) is a Domain Name Server (DNS) that is used to resolve host names to IP addresses."),
netconsole => N_("Initializes network console logging"),
netfs => N_("Mounts and unmounts all Network File System (NFS), SMB (Lan
Manager/Windows), and NCP (NetWare) mount points."),
network => N_("Activates/Deactivates all network interfaces configured to start
at boot time."),
'network-auth' => N_("Requires network to be up if enabled"),
'network-up' => N_("Wait for the hotplugged network to be up"),
nfs => N_("NFS is a popular protocol for file sharing across TCP/IP networks.
This service provides NFS server functionality, which is configured via the
/etc/exports file."),
nfslock => N_("NFS is a popular protocol for file sharing across TCP/IP
networks. This service provides NFS file locking functionality."),
ntpd => N_("Synchronizes system time using the Network Time Protocol (NTP)"),
numlock => N_("Automatically switch on numlock key locker under console
and Xorg at boot."),
oki4daemon => N_("Support the OKI 4w and compatible winprinters."),
partmon => N_("Checks if a partition is close to full up"),
pcmcia => N_("PCMCIA support is usually to support things like ethernet and
modems in laptops.  It will not get started unless configured so it is safe to have
it installed on machines that do not need it."),
portmap => N_("The portmapper manages RPC connections, which are used by
protocols such as NFS and NIS. The portmap server must be running on machines
which act as servers for protocols which make use of the RPC mechanism."),
portreserve => N_("Reserves some TCP ports"),
postfix => N_("Postfix is a Mail Transport Agent, which is the program that moves mail from one machine to another."),
random => N_("Saves and restores system entropy pool for higher quality random
number generation."),
rawdevices => N_("Assign raw devices to block devices (such as hard disk drive
partitions), for the use of applications such as Oracle or DVD players"),
resolvconf => N_("Nameserver information manager"),
routed => N_("The routed daemon allows for automatic IP router table updated via
the RIP protocol. While RIP is widely used on small networks, more complex
routing protocols are needed for complex networks."),
rstatd => N_("The rstat protocol allows users on a network to retrieve
performance metrics for any machine on that network."),
rsyslog => N_("Syslog is the facility by which many daemons use to log messages to various system log files.  It is a good idea to always run rsyslog."),
rusersd => N_("The rusers protocol allows users on a network to identify who is
logged in on other responding machines."),
rwhod => N_("The rwho protocol lets remote users get a list of all of the users
logged into a machine running the rwho daemon (similar to finger)."),
saned => N_("SANE (Scanner Access Now Easy) enables to access scanners, video cameras, ..."),
shorewall => N_("Packet filtering firewall"),
smb => N_("The SMB/CIFS protocol enables to share access to files & printers and also integrates with a Windows Server domain"),
sound => N_("Launch the sound system on your machine"),
'speech-dispatcherd' => N_("layer for speech analysis"),
sshd => N_("Secure Shell is a network protocol that allows data to be exchanged over a secure channel between two computers"),
syslog => N_("Syslog is the facility by which many daemons use to log messages
to various system log files.  It is a good idea to always run syslog."),
'udev-post' => N_("Moves the generated persistent udev rules to /etc/udev/rules.d"),
usb => N_("Load the drivers for your usb devices."),
vnStat => N_("A lightweight network traffic monitor"),
xfs => N_("Starts the X Font Server."),
xinetd => N_("Starts other deamons on demand."),
    );
    my ($name) = @_;
    my $s = $services{$name};
    if ($s) {
	$s = translate($s);
    } else {
	my $file = "$::prefix/lib/systemd/system/$name.service";
	if (-e $file) {
		$s = cat_($file);
		$s = $s =~ /^Description=(.*)/mg ? $1 : '';
	} else {
		$file = find { -e $_ } map { "$::prefix$_/$name" } '/etc/rc.d/init.d', '/etc/init.d', '/etc/xinetd.d';
		$s = cat_($file);
		$s =~ s/\\\s*\n#\s*//mg;
		$s =
			$s =~ /^#\s+(?:Short-)?[dD]escription:\s+(.*?)^(?:[^#]|# {0,2}\S)/sm ? $1 :
			$s =~ /^#\s*(.*?)^[^#]/sm ? $1 : '';

		$s =~ s/#\s*//mg;
	}
    }
    $s =~ s/\n/ /gm; $s =~ s/\s+$//;
    $s;
}

sub ask_ {
    my ($in) = @_;
    my %root_services = (
			 N("Printing") => [ qw(cups cupslpd cups-lpd hpoj lpd lpr oki4daemon) ],
                         
			 # FIXME: split part of 'Internet' into 'Security' or 'Firewall'?
			 N("Internet") => [ qw(adsl boa cddbp ftp httpd ibod ip6tables ippl iptables iptoip ipvsadm
                                               isdn4linux jabber jabber-icq jail.init junkbuster mandi nessusd pftp portsentry 
                                               prelude proftpd proftpd-xinetd pure-ftpd ipsec radvd roxen shorewall squid
                                               tftp) ],

			 N("_: Keep these entry short\nNetworking") => [ qw(network network-auth network-up resolvconf) ],

			 N("System") => [ qw(acon acpid alsa anacron apcupsd apmd atd bpowerd bpowerfail crond cvs dm fcron functions
                                             gpm halt harddrake inetd irda jserver keytable kheader killall mageia_everytime
                                             mageia_firstime mdadm medusa-init messagebus microcode_ctl mosix netconsole numlock partmon
                                             pcmcia portmap powertweak.init psacct
                                             random rawdevices rpcbind sensors single sound syslog syslog-ng ups usb usbd wine xfs xinetd) ],

			 N("Remote Administration") => [ qw(cfd drakxtools_http heartbeat iplog ldirectord mon netsaint olympusd rexec
                                                            rlogin rsh sshd telnet telnetd vncserver webmin) ],

#			 N("Network Client") => [ qw(arpwatch diald dnrd_rc fetchmail nscd rsync ypbind) ],
#			 N("Network Server") => [ qw(named bootparamd ntpd xntpd chronyd postfix sendmail
#                                                     imap imaps ipop2 ipop3 pop3s routed yppasswdd ypserv ldap dhcpd dhcrelay
#                                                     hylafax innd identd rstatd rusersd rwalld rwhod gated
#                                                     kadmin kprop krb524 krb5kdc krb5server hldsld bayonne sockd dhsd gnu-pop3d
#                                                     gdips pptpd.conf vrrpd crossfire bnetd pvmd ircd sympa finger ntalk talk) ],
			 N("Database Server") => [ qw(mysql postgresql) ],
			);
    my %services_root;
    foreach my $root (keys %root_services) {
	$services_root{$_} = $root foreach @{$root_services{$root}};
    }
    my ($l, $on_services) = services();
    my %services;
    $services{$_} = 0 foreach @{$l || []};
    $services{$_} = 1 foreach @{$on_services || []};

    $in->ask_browse_tree_info(N("Services"), N("Choose which services should be automatically started at boot time"),
			      {
			       node_state => sub { $services{$_[0]} ? 'selected' : 'unselected' },
			       build_tree => sub {
				   my ($add_node, $flat) = @_;
				   $add_node->($_, !$flat && ($services_root{$_} || N("Other")))
				     foreach sort keys %services;
			       },
			       grep_unselected => sub { grep { !$services{$_} } @_ },
			       toggle_nodes => sub {
				   my ($set_state, @nodes) = @_;
				   my $new_state = !$services{$nodes[0]};
				   foreach (@nodes) {
				       $set_state->($_, $new_state ? 'selected' : 'unselected');
				       $services{$_} = $new_state;
				   }
			       },
			       get_status => sub {
				   N("%d activated for %d registered", 
				     scalar(grep { $_ } values %services),
				     scalar(values %services));
			       },
			       get_info => sub { formatLines(description($_[0])) },