Christopher Baines writes: > +(define (patchwork-django-admin-gexp patchwork settings-module) > + #~(lambda command > + (let ((pid (primitive-fork)) > + (user (getpwnam "httpd"))) > + (if (eq? pid 0) > + (dynamic-wind > + (const #t) > + (lambda () > + (setgid (passwd:gid user)) > + (setuid (passwd:uid user)) > + > + (setenv "DJANGO_SETTINGS_MODULE" "guix.patchwork.settings") > + (setenv "PYTHONPATH" #$settings-module) > + (primitive-exit > + (if (zero? > + (apply system* > + #$(file-append patchwork "/bin/patchwork-admin") > + command)) > + 0 > + 1))) > + (lambda () > + (primitive-exit 1))) > + (zero? (cdr (waitpid pid))))))) > + > +(define (patchwork-django-admin-action patchwork settings-module) > + (shepherd-action > + (name 'django-admin) > + (documentation > + "Run a django admin command for patchwork") > + (procedure (patchwork-django-admin-gexp patchwork settings-module)))) It would be really useful to provide an easy way of accessing the Django admin utilities. I think Shepherd actions might be a good way of doing this, but I haven't got it working yet... I think something goes wrong when it forks, so I might need to try different approaches to change user.