> quite useful when you work in multiuser environment but it also breaks
> the compatibility with other interfaces.
Alas, it's true. There's also a bug filed on Launchpad:
https://bugs.edge.launchpad.net/ubuntu/+source/btpd/+bug/275326
which I've been pondering to forward to github.
My 2(euro)cents thoughts, we could either:
a) check which user started the daemon on kill request and refuse to
obey in case it doesn't match
b) provide something like a new switch to tell btpd to run in
system mode
Waiting for further suggestions... ;)
Cesare.
btpd was designed to work in a user-specific environment and honestly
I don't see a simple way to do otherwise.
Bye,
Alessandro.
2010/8/7 Cesare Falco <cesare...@gmail.com>:
I agree hard-coding the directory name is a *bad* idea, however it's
just a quick hack and it could be managed with a switch.
> btpd was designed to work in a user-specific environment and honestly
I guess you're referring to an environment in which only a single user
can start btpd, but Ubuntu is a multi-user environment in which
multiple users are supposed to use btpd.
Starting a different instance for each user would simply be a waste of
resources (ports and memory). The disadvantage of a single daemon is
that users must share what they download, but we're not speaking of
illegal material, are we? ;)
> I don't see a simple way to do otherwise.
btpd works good with the current configuration in Ubuntu, it only has
two issues:
1) "btcli kill" still stops the daemon in an unclean way, as does sudo
/etc/init.d/btpd stop
2) torrent files are put in subdirectories of /var/lib/btpd/files,
(hardcoded with a patch) which is owned by the "btpd" user and has no
world-wide write permission
To solve 1), btpd should be aware of what "mode" is running in, user
or system, and refuse to shutdown in the latter case.
To solve 2), a switch stating the base directory for the torrent
directory should suffice.
Cheers,
Cesare.
Theoretically speaking the best way to solve this problem is to split
the daemon in two parts: a common part which implements the core logic
of the application and another part that manages the I/O. We could ask
btpd to fork a new process with the right permission to handle the
user's I/O requests. This way we would have one shared process running
most of the code and many child processes (one per user) to handle the
I/O. I repeat: it's not simple and it would require a complete rewrite
of the program.
Bye,
Alessandro.
2010/8/9 Cesare Falco <cesare...@gmail.com>:
Cesare, I was talking about the code: there's not an easy way to
overcome the limits of btpd architecture. However starting a daemon
for each user is not such a great waste of resources because btpd is
very small (it was designer for this purpose).
What I was looking for was a way to make btpd act as a standalone,
unattended server, mainly for seeding rather than leeching files.
However, if you think this may confusing for users or harmul for
btpd's (deserved) good reputation, I can modify the package or even
ask for removal from official repos.
Cheers,
Cesare.
2010/8/10, Janne Johansson <icep...@gmail.com>:
Right now I'm working on gbtpd but I'll write a patch if no one is
willing to take care of this one.
Bye,
Alessandro.
2010/8/10 Cesare Falco <cesare...@gmail.com>: