Czy wszystkie skrypty w /etc/network/if-up.d są uruchamiane po uruchomieniu interfejsu sieciowego?
Jeśli tak, to po co komenda post-up w pliku interfejsów?
Czy wszystkie skrypty w /etc/network/if-up.d są uruchamiane po uruchomieniu interfejsu sieciowego?
Jeśli tak, to po co komenda post-up w pliku interfejsów?
Odpowiedzi:
Tak, generalnie uruchamiany jest każdy skrypt oznaczony jako wykonywalny i umieszczony w tym folderze. Pliki, które mają, są ograniczone do określonego zestawu nazw, ponieważ używane są części run.
post-upDziała tak samo jak używanie up. Umieszczenie skryptu w if-up.d jest tym samym, co zwykłe użycie polecenia, post-upktóre wskazuje skrypt lub polecenie w innym miejscu. Zwykle używasz up | post-up, gdy potrzebujesz tylko jednego polecenia dla jednego interfejsu. Gdy masz coś bardziej złożonego, możesz utworzyć skrypt.
interfejsy człowieka
...
up command
post-up command
Run command after bringing the interface up. If this command
fails then ifup aborts, refraining from marking the interface as
configured (even though it has really been configured), prints
an error message, and exits with status 0. This behavior may
change in the future.
...
There exists for each of the above mentioned options a directory
/etc/network/if-<option>.d/ the scripts in which are run (with no argu-
ments) using run-parts(8) after the option itself has been processed.
części biegowe człowieka
run-parts runs all the executable files named within constraints
described below,
If the --lsbsysinit option is not given then the names must consist
entirely of upper and lower case letters, digits, underscores, and
hyphens.
...
Files are run in the lexical sort order of their names unless the
--reverse option is given, in which case they are run in the opposite
order.