On Fri, 03.03.17 10:18, Dario Lesca ([email protected]) wrote:

> Gogs systemd service (gogs.service) must start after a DB is started.
> 
> Gogs can use mysql, mariadb, postgress, ecc db backend.
> 
> Now into service all this "After=" are commented and I must modify the
> gogs.service file and comment out the right After entry
> 
> > [Unit]
> > Description=Gogs
> > After=syslog.target
> > After=network.target
> > #After=mysqld.service
> > #After=mariadb.service
> > #After=postgresql.service
> > #After=memcached.service
> > #After=redis.service
> > 
> > [Service]
> https://github.com/gogits/gogs/blob/master/scripts/systemd/gogs.service
> 
> Now I have modify the gogs.service file, but I'm looking for a way to
> avoid modify the unit file
> 
> It's possible set After with all db service gogs needs, also if the
> some named services are non installed, something like this, or leave
> all After= directive uncommented:
> 
>     After=aaa.service bbb.service ccc.service
> 
> If not, there is a way to avoid modify the unit file and put into it
> something like this?
> 
>     AfterIfExist=aaa.service bbb.service ccc.service
> 
>     or another directive ?
> 
>     Many thanks for your suggest.

It's entirely OK to order yourself after non-installed units. Simply
list the After= lines you need, and all is good. After= has no effect
if the specified unit doesn#t exist and generates no errors. It's
intended use of this option to reference non-existing units.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to