Running Scribes as root

For a little while I had a painful time in getting the text editor scribes to run as root. You are probably wondering why i would want to run the text editor as root, but when you cant be bothered using vi or gedit and would like some pretty code highlighting then that is what you need to do. Anyway, as you may know I am running Ubuntu 7.10 Gusty and it is going “pretty” well for the most part. So the objective i wanted was to be able to launch scribes from the shell then have it edit my “whatever” configuration files. The problem that i was having looked somthing like the following :

binneyd@HAL:~$ sudo scribes /etc/fstab[sudo] password for binneyd:Traceback (most recent call last):  File "/usr/bin/scribes", line 38, in    main(argv[1:])  File "/usr/lib/python2.5/site-packages/SCRIBES/Main.py", line 45, in main    __open(uris)  File "/usr/lib/python2.5/site-packages/SCRIBES/Main.py", line 58, in __open    __open_via_dbus(uris)  File "/usr/lib/python2.5/site-packages/SCRIBES/Main.py", line 76, in __open_via_dbus    dbus_service = __get_dbus_service()  File "/usr/lib/python2.5/site-packages/SCRIBES/Main.py", line 109, in __get_dbus_service    from info import dbus_iface, session_bus  File "/usr/lib/python2.5/site-packages/SCRIBES/info.py", line 34, in    session_bus = SessionBus()  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 218, in __new__    mainloop=mainloop)  File "/var/lib/python-support/python2.5/dbus/_dbus.py", line 107, in __new__    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)  File "/var/lib/python-support/python2.5/dbus/bus.py", line 121, in __new__    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

After quite a bit of searching i found out that the Scribes application does not like to be run as root and will, not very gracefully, fail if you try to do it. So, you need to bypass this problem by using the dbus launch and away you go eg. :sudo dbus-launch scribes /etc/fstabThis was a little ugly of a solution so i just cleaned it up with an alias and that is about it.alias suscribes=’sudo dbus-launch scribes’So hope this helps and saves you some time as well 😉