'

Jerzy

Sobczyk

$

'

Jerzy

Sobczyk

$

Procedura exec

Tworzenie procesu

stary proces

program

program

$pid=fork();

if ($pid == 0)

dane

{ ........ child .........

}

elsif ($pid > 0)

{ ........ parent ......... }

nowy proces

else

dane

program

{ ........ error .........

}

dane

1

3

&

19

padziernika

1998

roku

PROCESY

ASU

%

&

19

padziernika

1998

roku

PROCESY

ASU

%

'

Jerzy

Sobczyk

$

'

Jerzy

Sobczyk

$

Pamięć procesu

proces 0

Sygnały

program

program

Perl:

C:

dane 0

$SIG{’QUIT’}=’DEFAULT’;

signal(SIGQUIT,SIG_DFL);

$SIG{’QUIT’}=’IGNORE’;

signal(SIGQUIT,SIG_IGN);

proces 1

dane 1

$SIG{’QUIT’}=proc;

signal(SIGQUIT,proc);

kill(’QUIT’, $pid);

kill(pid,SIGQUIT);

program

dane 0

sub proc() { ... }

void proc( int sig ) { ... }

dane 1

2

4

&

19

padziernika

1998

roku

PROCESY

ASU

%

&

19

padziernika

1998

roku

PROCESY

ASU

%

'

Jerzy

Sobczyk

$

'

Jerzy

Sobczyk

$

SIGHUP 1 – hangup

SIGINT 2 – interrupt (rubout) Komenda – crontab

SIGQUIT 3 – quit (ASCII FS)

SIGILL 4 – illegal instruction (not reset when caught) crontab [ filename ]

SIGTRAP 5 – trace trap (not reset when caught) crontab -e [username]

SIGIOT 6 – IOT instruction

SIGABRT 6 – used by abort, replace SIGIOT in the future crontab -r [username]

SIGEMT 7 – EMT instruction

crontab -l [username]

SIGFPE 8 – floating point exception minuta godzina dzień miesiąc dzień tygodnia komenda SIGKILL 9 – kill (cannot be caught or ignored)

• minuta – 0..59

SIGBUS 10 – bus error

• godzina – 0..23

SIGSEGV 11 – segmentation violation

• dzień (miesiąca) – 1..31

SIGSYS 12 – bad argument to system call

• miesiąc – 1..12

SIGPIPE 13 – write on a pipe with no one to read it

• dzień tygodnia – 0..6 (0=Niedziela, 1=Poniedziałek, ...) SIGALRM 14 – alarm clock

SIGTERM 15 – software termination signal from kill Pliki sterujące: /usr/sbin/cron.d/cron.allow, cron.deny SIGUSR1 16 – user defined signal 1

5

7

&

19

padziernika

1998

roku

PROCESY

ASU

%

&

19

padziernika

1998

roku

PROCESY

ASU

%

'

Jerzy

Sobczyk

$

'

Jerzy

Sobczyk

$

Komenda – at

at [-csm] [-f script] [-qqueue] time [date] [+ increment]

Komenda – crontab – przykłady at -l [ job...]

at -r job

#minuta godzina dzień miesiąc dzień tygodnia komenda Przykłady:

0 12 1 * * echo "Pierwszy - idz po wyplate"

at 8:15am Jan 24

0 12 * * 5 echo "Jutro Sobota!"

at now + 1 minute

0 * * * * kuku

at now next day

0 12 * 1,4,7,10 * echo "Poczatek kwartalu"

at 5 pm Friday

Pliki sterujące: /usr/sbin/cron.d/at.allow /usr/sbin/cron.d/at.deny 6

8

&

19

padziernika

1998

roku

PROCESY

ASU

%

&

19

padziernika

1998

roku

PROCESY

ASU

%

'

Jerzy

Sobczyk

$

'

Jerzy

Sobczyk

$

terminfo

Komenda tic

33|tty33|tty|model 33 teletype, tic file

cr=^M, cud1=^J, ind=^J, bel=^G, cols#72, hc, os concept100|c100|concept|c104|c100-4p|concept 100,

/usr/share/lib/terminfo/?/file is2=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E,

/usr/lib/terminfo/?/file

./file

cr=^M, cud1=^J, ind=^J, bel=^G, smcup=\EU\Ev 8p\Ep\r,

rmcup=\Ev

$<6>\Ep\r\n, il1=\E^R$<3*>, am, cub1=^H, plik z definicja

skompilowana

ed=\E^C$<16*>, el=\E^U$<16>, clear=^L$<2*>, definicja

cup=\Ea%p1%’ ’%+%c%p2%’ ’%+%c, cols#80, dch1=\E^A$<16*>,

.....

9

11

&

19

padziernika

1998

roku

PROCESY

ASU

%

&

19

padziernika

1998

roku

PROCESY

ASU

%

'

Jerzy

Sobczyk

$

'

Jerzy

Sobczyk

$

cr – carriage return

cud1 – down one line

Plik /etc/printcap

ind

bel – audible bell

cols – number of columns

lp|hpj:\

hc – hard copy terminal

os – can overstike

:lp=/dev/lp1:\

is2 – initialization string

:sd=/usr/spool/lp1:\

smcup – string to start program using cup

:of=/usr/spool/lp1/hpjlp:

rmcup – string to end program using cup

:lf=/usr/spool/lp1/hp-log:

il1 – insert line

lp – printer device

ed – clear to the end of screen el – clear to the end of line sd – spool directory

am – has automatic margins

of – output filter

clear – clear screen and move cursor to home position lf – log file

cup – move to row #1 columns #2

rm – remote machine

dch1 – delete character

10

12

&

19

padziernika

1998

roku

PROCESY

ASU

%

&

19

padziernika

1998

roku

PROCESY

ASU

%