Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service running? #17

Open
AstraLuma opened this issue May 9, 2020 · 1 comment
Open

Service running? #17

AstraLuma opened this issue May 9, 2020 · 1 comment

Comments

@AstraLuma
Copy link
Contributor

Ok, so I'm reading https://www.collabora.com/news-and-blog/blog/2019/03/27/modern-usb-gadget-on-linux-and-how-to-integrate-it-with-systemd-part-2/ and i'm like.... this is nuts. (I have an uneasy truce with systemd on the best of days.)

Could gt learn to start a service, the process being:

  1. load the scheme
  2. mount the ffs
  3. start the service
  4. enable the gadget
  5. Wait on the service (with signal forwarding?)
  6. Unmount the ffs
  7. remove the scheme
  8. return the return code of the service

It doesn't need to do full daemon management, just wrap another program to do the necessary usb init/etc.

For the record, I'm using gt with https://github.com/viveris/uMTP-Responder/ because I wrote my own script to do all this and having an actual declarative file is much nicer.

@pabs3
Copy link
Member

pabs3 commented Jul 13, 2021

@AstraLuma I think that would be fragile and it would be better to do the above in an event driven way using the systemd dependencies mentioned in the post from @andrzejtp you linked above.

@andrzejtp I think that we should import more of the setup in the blog post above, but instanced, so you can drop your scheme in /etc/gt/ffs/foo.scheme, configure which daemon service to start and then start an instance of the relevant services. Thoughts?

BTW @andrzejtp added some of their systemd setup to gt in commit ed35e2f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants