Conversation
|
as I said, I'm unfamiliar to git - this merge request has everything in it, I did in the fork. It contains also the changes we disagreed, sorry for that. |
|
=> almost forgotten: I changed the name "sync.php" to sfs-sync.php, so it is more clear in the processlist, or as a global executeable |
| //batch dir, if this is the same for all nodes | ||
| $BATCHDIR = '/mnt/batches/'; | ||
| //drop privileges to user if different from 0, needs a restart if changed | ||
| $UID = 0; |
There was a problem hiding this comment.
I do not want to handle this in php sync. Systemd is perfectly able to drop privileges within the service file.
There was a problem hiding this comment.
that was your code - I only added the options to the config file,in case someone don't use systemd. And for templated services you can't add a dynamic user/group too. You had to write an extra config for systemd to read.
There was a problem hiding this comment.
Yes didn't want to add extra stuff like this to the daemon. It's old code and we hope to transition to systemd. What's the reason for adding $UID to the config too?
There was a problem hiding this comment.
the idea behind templated services is to have one template and instantiate this template with one parameter. @xxx. So you don't have to manually copy the file & change it.
So the parameter is mostly a port or a configuration file. Since systemd can't handle php files we would need 2 config files for one service. I thought this makes it more complex.
There was a problem hiding this comment.
Ok so the problem is that the two services are running with different users. That's fine then. Once again we have to reinvent things at app level because the service manager isn't able to template User and Group. Understandable :)
|
I had another problem, what should be fixed by my latest commit: All these errors seems only to occur if you have "big transactions", e.g. >1000 files are changed which can be due to chmod/chown, or a mv operation. |
|
I'm quite opposed to add a systemd service. It's just few lines of code and you are probably going to edit it anyway. It complicates all the documentation about |
docs/INSTALL.md
Outdated
| -------------------- | ||
| Install php, if not already present. | ||
|
|
||
| Make sure you have installed php together with: |
There was a problem hiding this comment.
Please mention this only applies to rpm-based distros.
There was a problem hiding this comment.
does debian have only one big php install file?
On php.net these modules are marked as optional, so they may not be installed. I can name this after the php modules that have to be present.
There was a problem hiding this comment.
I didn't have to install anything in addition to php on debian.
There was a problem hiding this comment.
looks like the current situation:
https://packages.debian.org/en/wheezy/php5-cli
but this may change with newer releases, php states this as extensions which are optional, so its to the maintainer to bundle all, or make these extra packages:
http://php.net/manual/en/book.sem.php
I changed the documentaion which should make it clearer.
php-sync/sfs-sync.php
Outdated
| foreach ($batches as &$batch) { | ||
| if (!preg_match ("/^[^_]+_([^_]+)_[^.]+\.batch$/", $batch, $match)) { | ||
| if (!preg_match ("/^\d+_([^_]+)_.*\.batch$/", $batch, $match)) { | ||
| /*if(!empty($this->config["LOG_DEBUG"])){ |
There was a problem hiding this comment.
Why is this commented?
|
I changed the glob back to readdir, as suggested. |
So, in short what did I do:
I think that's all for now :-) Currently I'm just expermenting a bit, with the default config it takes 60 seconds before a file is transferred to the destination.