Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
systemd: directiva "Entorno" para establecer la RUTA

¿Cuál es la forma correcta de establecer la variable PATH en un archivo de unidad systemd ? Después de ver algunos ejemplos, intenté usar el siguiente formato, pero la variable no parece expandirse.

 Environment="PATH=/local/bin:$PATH"

Estoy intentando esto en CoreOS con la siguiente versión de systemd.

 systemd 225 -PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS -ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

No puede usar EnvVars en directivas de Environment . Todo Environment= será ignorado. Si usa EnvironmentFile= , el archivo especificado se cargará sin sustitución. Así que PATH=/local/bin:$PATH sería exactamente eso, y probablemente esto no sea lo que quieres.

Bajo CentOS7 funciona lo siguiente.

 # /etc/systemd/system/nagios.service.d/env.conf [Service] Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" > sudo systemctl daemon-reload > sudo systemctl restart nagios > sudo cat /proc/28647/environ ... PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin ...
over 4 years ago · Santiago Trujillo Report

0

Puede usar la directiva EnvironmentFile= en la sección de units para establecer variables de entorno.

Simplemente coloque las variables como pares key=value y funcionará.

El tiempo de ejecución simplemente 'fuente es cualquier archivo que especifique.

Puede crear el archivo usando la directiva write_files .

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!