• 12
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I have a bunch of job/daemon configuration files, say:

/etc/init/service1.conf
/etc/init/service2.conf
/etc/init/service3.conf

Most of those jobs are quite similar, and the files are of a format like:

description "Some service"

...
env NAME1=VALUE1
env NAME2=VALUE2
env NAME3=VALUE3
...

exec something

The env variable section is the same across all files. Is there an easy way to avoid having to repeat the variables in all the files, while also not setting them system-wide (they should only be visible to the jobs)? Something like a #include "env_config.txt" that I can replace the env section in the configs with?

    • You could do that with systemd. But Ubuntu was very late adopting it, and so you'll need to be on 16.04 LTS or later.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags