2012-10-20 13 views
19

Sto tentando di esportare la mia applicazione in un altro formato/sistema di gestione processo (in particolare, upstart). In tal modo, mi sono imbattuto in una serie di ostacoli, principalmente a causa della mancanza di documentazione.Come utilizzare il caposquadra per esportare in upstart?

Come utente non root, ho eseguito il seguente comando (come mostrato here):

-bash> foreman export upstart /etc/init 
ERROR: Could not create: /etc/init 

I "non sono riuscito a creare" la directory a causa di autorizzazioni inadeguate, così ho usato sudo:

-bash> sudo foreman export upstart /etc/init 
Password: 
ERROR: Could not chown /var/log/app to app 

I "Impossibile chown ... all'app" perché non esiste un utente denominato app.

Da dove proviene app?

Come dovrei usare forman per esportare in upstart?

risposta

26

appis default sia per il nome dell'app e il nome dell'utente l'applicazione dovrebbe essere eseguito come quando non vengono utilizzate le opzioni corrispondenti (--app e --user). Vedere the foreman man page per le opzioni disponibili, ma nota che, al momento in cui scriviamo la sinossi ufficiale non comprendeva [opzioni]:

foreman export [options] <format> [location] 

Esempio:

-bash> sudo foreman export --app foo --user bar upstart /etc/init 
Password: 
[foreman export] writing: foo.conf 
[foreman export] writing: foo-web.conf 
[foreman export] writing: foo-web-1.conf 
[foreman export] writing: foo-worker.conf 
[foreman export] writing: foo-worker-1.conf 

Risultato:

-bash> l /etc/init/ 
total 80 
drwxr-xr-x 12 root wheel 408 20 Oct 09:31 . 
drwxr-xr-x 94 root wheel 3196 20 Oct 08:05 .. 
-rw-r--r-- 1 root wheel 236 20 Oct 09:31 foo-web-1.conf 
-rw-r--r-- 1 root wheel 41 20 Oct 09:31 foo-web.conf 
-rw-r--r-- 1 root wheel 220 20 Oct 09:31 foo-worker-1.conf 
-rw-r--r-- 1 root wheel 41 20 Oct 09:31 foo-worker.conf 
-rw-r--r-- 1 root wheel 315 20 Oct 09:31 foo.conf 

-bash> l /var/log/foo/ 
total 0 
drwxr-xr-x 2 bar  wheel 68 20 Oct 09:31 . 
drwxr-xr-x 45 root wheel 1530 20 Oct 09:31 ..