Repository navigation
Fix install, uninstall and status, drop reload and the quiet hook, clean up the gem - #15
Merged
Merged
Conversation
Vérifié sur un serveur de test (Ubuntu 24.04, systemd 255, connexion SSH en deploy avec sudo, /etc/systemd/system non inscriptible) : - install en mode :system échouait (scp refusé dans /etc/systemd/system) : l'unité est envoyée dans :tmp_dir puis déplacée avec sudo_if_needed (sudo mv en :system, mv sinon) ; - install appelait invoke "solid_queue:enable" depuis le bloc on roles, qui relance enable sur tous les serveurs depuis le premier : enable est maintenant lancé dans le même bloc, après daemon-reload ; - uninstall supprimait <nom>* (et donc l'unité d'un autre stage au nom plus long) sans sudo (Permission denied en :system) : il supprime <nom>.service avec sudo_if_needed ; - status s'arrêtait sur le code 3 de systemctl status pour un service arrêté : il ne lève plus d'erreur ; - ExecReload envoyait SIGTSTP, que Solid Queue n'intercepte pas et que le noyau ignore pour le processus principal d'un service : reload ne faisait rien. La tâche reload et ExecReload sont supprimées ; - le hook quiet après deploy:starting envoyait SIGTERM, ce qui arrête Solid Queue (pas de mode quiet) pendant tout le déploiement : retiré, la tâche reste disponible. Le rendu du template est factorisé dans Systemd#service_unit, le nom du fichier d'unité dans Systemd#service_unit_file ; le double mkdir -p d'install disparaît. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- required_ruby_version >= 3.1.0 (la CI teste 3.1 à 4.0), standard en ruby_version 3.1 ; - capistrano >= 3.5 : capistrano/plugin n'existe pas dans la 3.4.1 et existe dans la 3.5.0, avec tout ce que le plugin utilise ; - changelog_uri pointe vers CHANGELOG.md (aucune release GitHub) ; - summary et description décrivent le gem, bindir et executables (pas de dossier exe/) sont retirés ; - sig/ supprimé : signature fausse (class au lieu de module) et jamais vérifiée ; .standard.yml et Rakefile ne sont plus dans le gem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README : liste des tâches reprise de cap -T, sans reload ; hooks sans quiet ; linger à activer une fois pour un service utilisateur (vérifié : sans linger, le service s'arrête à la déconnexion) ; coquille, stage manquant dans l'exemple et lien du code de conduite corrigés. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from a review of the whole gem, checked on a test server: Ubuntu 24.04 with systemd 255 in Docker, Capistrano connecting over SSH as
deploy, who hassudobut can't write to/etc/systemd/system. Each task below was run withmainand with this branch.Tasks
maininstall,:systemmodescpcan't write to/etc/systemd/system/:tmp_dir, thensudo mv; unit enabled,User=deployuninstall,:systemmodermwithoutsudo,Permission deniedsudo rm -f <name>.serviceuninstall, user mode, withapp_solid_queue_preprod_eu.servicenext to the unitrm -f <name>*)app_solid_queue_preprod.servicestatuson a stopped servicecapaborts onsystemctl statusexit status 3Active: inactive (dead)installused to callinvoke "solid_queue:enable"from inside itson rolesblock.enablethen ran on every server from the first one, possibly before the unit reached the others.installnow runssystemctl enablein the same block, afterdaemon-reload. This race was not reproduced; the test checks that theenabletask isn't invoked and thatenablefollowsdaemon-reload.solid_queue:reloadandExecReload=/bin/kill -TSTP $MAINPIDare removed. Solid Queue 1.7.2 doesn't trapTSTP, and in the test container asystemctl reloadsendingTSTPto the main process of a service left it running unchanged (stateSs), so the task did nothing.solid_queue:quiethook afterdeploy:startingis removed: itsSIGTERMmakes Solid Queue shut down (supervisor/signals.rb:TERM→stop,terminate_gracefully), so jobs stopped for the whole deploy. The service is now stopped afterdeploy:updatedand started afterdeploy:published. The task itself stays.Systemd#service_unit(it was duplicated ingenerateandinstall), the unit file name toSystemd#service_unit_file. The duplicatemkdir -pofinstallgoes away.Gem
standardtargets 3.1.capistrano/pluginis missing from 3.4.1 and present in 3.5.0, with everything the plugin uses (set_defaults,define_tasks,register_hooks,eval_rakefile,backend,DSL#sudo,set_if_empty). Only 3.20.1 is tested.changelog_uripoints toCHANGELOG.md(the repo has no GitHub release).bindirandexecutablesremoved (there is noexe/).sig/removed: the signature declaredclass SolidQueueinstead of a module, withoutSystemd, and nothing checked it..standard.ymlandRakefileare no longer packaged.gem buildnow shipslib/, the gemspec,README.md,CHANGELOG.md,LICENSE.txtandCODE_OF_CONDUCT.md.README
cap -T, withoutreload; hooks withoutquiet.loginctl enable-linger deploy.cap … solid_queue:restartexample, and the code of conduct link ([USERNAME]placeholder) fixed.Tests
install(user mode: unit moved into place,enableafterdaemon-reload,solid_queue:enabletask not invoked;:systemmode:mvthroughsudo),uninstall(only this unit;rmthroughsudoin:systemmode),statuson a failingsystemctl, a dry-rundeployrunningsolid_queue:stopthensolid_queue:startonly, noreloadtask, noExecReload=.upload!,mkdir,mv,daemon-reloadorenableline ofinstall, thermline ofuninstall,raise_on_non_zero_exit: falseofstatus, or theFile.writeofgeneratemakes at least one test fail.bundle exec rake(tests + standard): green locally (Ruby 4.0.6).Upgrade
Run
cap <stage> solid_queue:installagain after upgrading, so the installed unit loses itsExecReload=line.🤖 Generated with Claude Code