process name should be "maas-regiond" not "/usr/bin/python /usr/bin/twisted"

Bug #1381390 reported by Mark Shuttleworth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Wishlist
Unassigned

Bug Description

When running ps ax I see something like this:

47624 ? Ssl 3:55 /usr/bin/python /usr/bin/twistd -n --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid --logfile=/dev/null maas-pserv --config-file=/etc/maas/pserv.yaml

What I'd expect to see on a region+cluster is:

47624 ? Ssl 3:55 maas-regiond
47628 ? Ssl 3:55 maas-clusterd

At the moment, I currently see:

shared@maas:~$ ps ax | grep maas
  685 ? S 0:00 avahi-daemon: running [maas.local]
19553 ? Ss 0:01 /usr/sbin/dhcpd -user dhcpd -group dhcpd -f -q -4 -pf /run/maas/dhcp/dhcpd.pid -cf /etc/maas/dhcpd.conf -lf /var/lib/maas/dhcp/dhcpd.leases em1
32647 pts/21 S+ 0:00 grep --color=auto maas
47624 ? Ssl 3:55 /usr/bin/python /usr/bin/twistd -n --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid --logfile=/dev/null maas-pserv --config-file=/etc/maas/pserv.yaml
47626 ? Sl 48:36 (wsgi:maas) -k start
47627 ? Sl 50:12 (wsgi:maas) -k start
47759 ? Ss 0:00 postgres: maas maasdb ::1(43721) idle
47760 ? Ss 0:00 postgres: maas maasdb ::1(43722) idle

Revision history for this message
Gavin Panella (allenap) wrote :

The bulk of the region controller runs within mod_wsgi in Apache, so
changing the process name may affect the "(wsgi:maas) -k start" lines.
In other words, you'd have multiple maas-regiond processes. Changing the
process title for the cluster should work as described.

There are two libraries that I know of for changing the process title
for Python, setproctitle and procname. The former is packaged as
python-setproctitle but it's in universe. The latter is not packaged,
but source is available at https://code.google.com/p/procname/.

The path of least resistance and least surprise would be to use
setproctitle if it's installed, and do nothing if not. Can we hint at a
package in universe (python-setproctitle) from packages in main (maas*)?

I also found the following code snippet:
http://ubuntuforums.org/showthread.php?t=694331&s=b5d7351d5a8409b929b5bca1585c9b48&p=4321311#post4321311

We may be able to put that into MAAS directly, or port it to use ctypes
(which avoids a compilation step). I have some experience with ctypes so
I'm happy to give that a go.

The principle amongst all of these possibilities is to copy a new
process title into the C-level argv[0]. setproctitle is based on a
PostgreSQL library to do this in a cross-platform way. We don't need
cross-platform compatibility, but the fact that it's PostgreSQL is
reassuring. The code snippet has no bounds checking so it appears to be
risky to use as-is. I don't know enough about procname to comment.

Changed in maas:
status: New → Triaged
importance: Undecided → Wishlist
Changed in maas:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.