Возможно, существуют более простые и надежные способы передачи файлов, но этот должен работать:
base64 кодируйте ваш файл на хост-системе
base64 file > file.64
Перенаправьте последовательный вывод в файл на Pi:
cat < /dev/ttyAMA0 > file.64
Используйте функцию minicom paste: Ctrl + A, Y, затем выберите файл для передачи. Нажмите Ctrl + D на Pi после завершения передачи.
file.64
Теперь декодируйте его в base64:
base64 -d file.64 > file
Преобразование base64 необходимо, потому что двоичные файлы передаются и эхом, и некоторые последовательности могут изменить или прервать сеанс, испортить терминал или испортить передачу. Любое другое преобразование, которое предотвращает передачу "небезопасных" символов обратно на экран, тоже подойдет, но base64 кажется подходящим вариантом, и он установлен на Pi по умолчанию.
Para eso están las directivas WantedBy=
y RequiredBy=
en los archivos unitarios systemd
:
WantedBy=, RequiredBy=
This option may be used more than once, or a space-separated list of unit names may be given. A symbolic link is created in the.wants/ or.requires/ directory of each of the listed units when this unit is installed by systemctl enable. This has the effect that a dependency of type Wants= or Requires= is added from the listed unit to the current unit. The primary result is that the current unit will be started when the listed unit is started. See the description of Wants= and Requires= in the [Unit] section for details.
Entonces, el enlace simbólico creado es lo que hace que systemd
inicie la unidad dada cuando se inicia el objetivo/la unidad.
Entonces, por ejemplo:
[Install]
WantedBy=graphical.target
Causaría que la unidad solo se inicie cuando graphical.target
se ejecuta (si la unidad está habilitada ).
Otro ejemplo:
[Install]
WantedBy=my-custom-target.target graphical.target
Haría que la unidad se iniciara cuando se ejecuta my-custom-target.target
o graphical.target
(si la unidad está habilitada ).
Una última cosa a tener en cuenta, puede ser difícil restringir las cosas a un solo objetivo porque algunos objetivos dependen de otros. Por ejemplo, graphical.target
Requires=multi-user.target
, por lo que cuando se inicia graphical.target
, todas las unidades desde multi-user.target
también se inician. Solo tenga en cuenta que algunos objetivos se construyen encima de otros, y que los que se construyen encima obtendrán todo de los objetivos de los que dependen.
No hay una equivalencia directa con chkconfig --level 5 iptables on
. No tiene sentido y es confuso seguir pensando en términos del antiguo sysvinit. No existe tal cosa como un nivel de ejecución en systemd.
Dicho esto... puede pedirle al administrador del servicio que inicie iptables solo cuando se alcance graphical.target usando WantedBy=graphical.target en la sección [Instalar] del servicio.