You are not logged in.
Pages: 1
I am trying to make an app that will mount inserted USB drives.
I had a hunch that the mount() function call would require admin rights for doing its job (its also written on the man page) but i decided to go on.
To me it seems like a server/client architecture is going to be needed.
Server waits for device to be mounted -> notifies a client running as user that gives it details on how to mount it -> the server mounts it accordingly
But it's not quite clear to me how the client and server should communicate. DBus doesn't really work since they don't have a commong bus (unless i misunderstood how dbus works)
Sockets sounds like a complication.
The idea was to have the DE/WM launch this on startup and have auto mounted drives
Offline
Most DEs have this functionality through udisks2.
Offline
I know. i just want to build my own for some fun
Offline
And you probably want to follow the pack and therefore use udisks2 - have you looked into that?
DBus doesn't really work since they don't have a commong bus (unless i misunderstood how dbus works)
udisks listens on the sysystem bus, if your system has more than one of those, you've bigger problems than disk mounting ![]()
Offline
No i dont have more than 1 system session i was talking about system/user session. I guess i could connect to both.
I mainly need the user session to emit notifications when one drive was mounted.
I just want to build something for fun, why do you have to shove udisks down my throat
Offline
I just want to build something for fun, why do you have to shove udisks down my throat
Nobody did? Scimmia pointed out what's common and you had not prima-face ruled that out.
You'll need some other leverage, either polkit, sudo or sth. like pmount was common ages ago.
Offline
You'll need some other leverage, either polkit, sudo or sth. like pmount was common ages ago.
well - going out of my comfort zone: why would a user-session daemon require root privileges itself if all it does is to communicate with some service running as root via typical IPC like a socket?
given OP write two parts - as they wrote one part running as system service with root privileges and another one running as user-application without I don't see any issue when these two parts communicate over a socket - or does a non-privileged connection to a socket running in privileged level to be privileged as well (which would somewhat defeat the idea of IPC)?
Offline
why would a user-session daemon require root privileges itself if all it does is to communicate with some service running as root via typical IPC like a socket?
Afaiu the OP they explicitly do NOT want to use udisks.
You'll need something running UID0 to do the mounting (or an fstab entry)
given OP write two parts - as they wrote one part running as system service with root privileges and another one running as user-application
… they would essentially have re-invented udisks.
Offline
Pages: 1