Public bug reported:

I met a problem to use systemd to startup a program which needs to talk
to GDK Broadway backend.

(We are prepared to contribute $Aus 1000 for speedy fix.)
Is this the correct location?

The whole story is that I am in the progress to migrate a GTK+3
application to web based on Nignx/Nodejs/Broadway. Using systemd to
startup a Nodejs application which will "spawn" a Broadway instance and
a GTK+3 application when user logins in. And the GTK+3 application will
"display" on that Broadway instance.

Interesting thing is that when I execute that Nodejs application through
terminal, everything works perfectly.

When I use systemd to startup that Nodejs application, after user logins
in, Broadway instance is up, the GTK+3 application is up then exit with
the error message: "Gtk-WARNING **: cannot open display:"

I googled for a while and didn't find many useful information. So I am not sure 
it is that systemd doesn't support GUI or I just made a stupid mistake.

Anyway, thanks a lot in advance.

The systemd service file of the Nodejs application looks like this:


ExecStart=/usr/bin/nodejs /path/to/Nodejs/application


The Nodejs application code looks like this:

... ...

var spawn = require('child_process').spawn;

... ...

var env = Object.create(process.env);
env.LOGNAME                         = username;
env.GDK_BACKEND                 = 'broadway';
env.BROADWAY_DISPLAY        = port_id;
env.SAL_USE_VCLPLUGIN        = 'gtk3';
env.UBUNTU_MENUPROXY      = '';
env.HOME                                = 'XXXXXXX';

const instance = spawn('/path/to/gtk3/application', [], { env: env });
instance.stdout.on('data', (data) => {
      console.log(`stdout: ${data}`);

instance.stderr.on('data', (data) => {
      console.log(`stderr: ${data}`);
instance.on('close', (code) => {
      console.log(`child process exited with code ${code}`);

** Affects: ubuntu-docs (Ubuntu)
     Importance: Undecided
         Status: New

You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

  Systemd startup Broadway backend

To manage notifications about this bug go to:

ubuntu-bugs mailing list

Reply via email to