Hey there,

I tried to write a service file for a service that depends on an instantiated service, but I always got errors, when I tried to enable the service. Is it possible for one service to depend on another instantiated service?

To be more specific, I wrote a service file for the gnome-keyring daemon. However, gnome-keyring depends on an active dbus, so I tried to make the gnome-keyring service depend on the dbus-session service, but with every syntax I tried, I got errors.
@ depends = ( dbus-session-@ @I )
gave me
66-enable: info: Read service file of : thededem from: /tmp/thededem:gc48Xy
66-enable: info: Service : /etc/66/service/gnome-keyring-@ thededem depends on : dbus-session-@ thededem
66-enable: info: Read service file of : thededem from: /tmp/thededem:q0YXMo
66-enable: info: /usr/lib/66/service/dbus-session-@ thededem: haven't dependencies
66-enable: tracing: Write service gnome-keyring-thededem ...
66-enable: info: write resolve file of: gnome-keyring-thededem
66-enable: info: Service written successfully: gnome-keyring-thededem
66-enable: warning: Ignoring: dbus-session-thededem service: already enabled
66-enable: fatal: unable to resolve source of graph for tree: user
@ depends = ( dbus-session-@ I )
gave me
66-enable: info: Read service file of : thededem from: /tmp/thededem:dexnh9
66-enable: info: Service : /etc/66/service/gnome-keyring-@ thededem depends on : dbus-session-thededem
66-enable: warning: unknown service: dbus-session-thededem: Success
66-enable: warning: unable to resolve source path of: dbus-session-thededem
66-enable: fatal: unable to parse service file: gnome-keyring-@ thededem: or its dependencies
Did I miss something and is there a way to depend on instantiated services or is 66 currently not capable of that?

Best regards
@ depends=(dbus-session-@ thededem)

maybe you can show me your complete frontend file?

Also, the next release will change the name of instantiated service to avoid this kind of confusion
Sue, here is the complete frontend file. The filename is "gnome-keyring-@ "
[main]
@ type = longrun
@ name = gnome-keyring-@ I
@ description = "Gnome Keyring Daemon"
@ user = ( user )
@ depends = ( dbus-session-@  )
@ options = ( log )

[start]
@ build = auto
@ execute = ( /usr/bin/gnome-keyring-daemon -f --start -c secrets,pkcs11 )

[logger]
@ build = auto
@ timestamp = iso
yes replace your key @ depends by @ depends=( dbus-session-@ thededem ), obviously the dbus-session-thededem service should be already created and available on your tree.
The format @ depends = ( dbus-session-@ @ I ) will be available on next release (currently works on dev branch)
The dbus-session-thededem service is enabled and running, but it seems it doesn't make a difference, if I use @ depends=( dbus-session-@ thededem ) or @ depends=( dbus-session-@ @ I ). Debug messages and the error are the same. Also the debug message
66-enable: info: Service : /etc/66/service/gnome-keyring-@ thededem depends on : dbus-session-@ thededem
which I get in both cases, seems to indicate, that @ I is correctly replaced by thededem, if I use @ depends=( dbus-session-@ @ I ).
congrats, you found one :).
Let me a few hours and i will patch and make a new release to solve this awaiting the next real release.
Please update your system to get the new release of 66 (0.2.0.4-3). It should works now.
Tell me if it's ok please.

Many thanks for your reports, this help a lot :)
After the update, now it works!

Thanks very much for the quick fix! :)

Powered by Obarun