Enhancement #732
closedpassenger: a better path for restart.txt
100%
Description
Following https://projects.duckcorp.org/issues/718#note-10:
Passenger looks for restart.txt
below /usr/share/redmine/tmp/
directory (thanks strace
).
Setting either PassengerAppRoot
or PassengerRestartDir
would allow to use a better directory something like /var/lib/redmine/dc/tmp/restart.txt
.
Updated by Pierre-Louis Bonicoli over 3 years ago
- Related to Bug #718: redmine: unable to register a new account added
Updated by Pierre-Louis Bonicoli over 3 years ago
Fixed by ansible-role-redmine|315f45da67f8b531563c2c09be6395d01948a4ee.
Tested with dc
instance on Toushirou
:
root@Toushirou:~# ps aux|grep redmine_ www-data 17860 1.8 0.2 407760 141920 ? Sl 22:28 0:02 Passenger RubyApp: redmine_md www-data 17870 0.5 0.2 407860 131908 ? Sl 22:28 0:00 Passenger RubyApp: redmine_md www-data 25087 4.0 0.2 407772 142832 ? Sl 22:29 0:02 Passenger RubyApp: redmine_dc www-data 25122 0.8 0.2 407872 127120 ? Sl 22:29 0:00 Passenger RubyApp: redmine_dc root@Toushirou:~# touch /var/cache/redmine/dc/tmp/restart.txt root@Toushirou:~# ps aux|grep Pas www-data 4663 21.6 0.2 407760 137860 ? Sl 22:32 0:00 Passenger RubyApp: redmine_dc www-data 4671 19.3 0.2 407860 134824 ? Sl 22:32 0:00 Passenger RubyApp: redmine_dc www-data 17860 1.5 0.2 407760 148476 ? Sl 22:28 0:03 Passenger RubyApp: redmine_md www-data 17870 0.2 0.2 407860 131908 ? Sl 22:28 0:00 Passenger RubyApp: redmine_md
The redmine DC instance only has been restarted, the redmine md instance hasn't.
Updated by Pierre-Louis Bonicoli over 3 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied with:
ansible-playbook playbooks/tenants/arnau/web/projects.mini-dweeb.org.yml -vv --diff ansible-playbook playbooks/tenants/duckcorp/web/projects.duckcorp.org.yml -vv --diff
Updated by Marc Dequènes over 3 years ago
- Status changed from Resolved to Feedback
I don't understand what's going on. In the past that worked fine. The app directory is supposed to be set to /var/lib/redmine/<instance> nd the tmp directory inside points to /var/cache/redmine/<instance>/tmp.
I understand using PassengerRestartDir fixes the restart problem but I wonder why the behavior changed and also what other consequences it may have: for eg if saving attachments in tickets is not gonna fail etc. I guess it works thanks to the multi-instance patch but that's still weird because I'm totally sure it worked before. Also this is conform to `/usr/share/doc/redmine/examples/apache2-passenger-host.conf`. So either something is still wrong on our side or something changed and the example config in the packager also need to be updated but I have no idea which.
Updated by Pierre-Louis Bonicoli over 3 years ago
Marc Dequènes wrote:
I don't understand what's going on. In the past that worked fine.
It didn't work seven months ago.
The app directory is supposed to be set to /var/lib/redmine/<instance>
What do you mean by app directory
? Which Passenger variable is that ?
and the tmp directory inside points to /var/cache/redmine/<instance>/tmp.
The paths where restarts.txt
are in this order:
- PassengerAppRoot + "/tmp/restart.txt" if PassengerRestartDir isn't defined
- PassengerRestartDir + "/restart.txt" if PassengerRestartDir starts with "/"
- PassengerAppRoot + PassengerRestartDir + "/restart.txt"
I understand using PassengerRestartDir fixes the restart problem but I wonder why the behavior changed and also what other consequences it may have: for eg if saving attachments in tickets is not gonna fail etc.
Are attachments stored below PassengerRestartDir
?
By default:I guess it works thanks to the multi-instance patch but that's still weird because I'm totally sure it worked before. Also this is conform to
/usr/share/doc/redmine/examples/apache2-passenger-host.conf
. So either something is still wrong on our side or something changed and the example config in the packager also need to be updated but I have no idea which.
- Passenger assumes that the application's root directory is the parent directory of the DocumentRoot
/usr/share/doc/redmine/examples/apache2-passenger-host.conf
definesDocumentRoot /usr/share/redmine/public
then/usr/share/redmine/public/../tmp/restart.txt
is used.
Both /usr/share/doc/redmine/examples/apache2-passenger-host.conf
and /usr/share/redmine/bin/redmine-instances
could be updated. If you agree with the previous change I suggest to I send a patch :)
Updated by Marc Dequènes over 3 years ago
- Status changed from Feedback to Resolved
So I guess my recollection is from an older time then, probably at a time when I was not taking care of the package and things may have been different.
I looked into the current patch and all paths are adapted in the code, not just postinst tasks. And despite /var/lib/redmine/<instance> having a few symlinks this is clearly not sufficient to be the app root. I was referring to the fact you can set the root independently of the DocumentRoot using PassengerAppRoot and was expecting it to be set differently for each instance. Attachments are not stored in PassengerRestartDir but since the app root is not what I thought it should be in /var/lib, then I wondered how they would end-up being saved in /var/lib/redmine/<instance>/files/ but the patch does the trick.
I'm sorry I was too tired to look at the patch yesterday but I wanted to write down this concern. Anyway, I did not recall correctly and the patch does all the path adaptation and the restart seem to be the only piece broken, I'll update the config example in the package, no need to create a patch.
Thanks for helping clarifying.