Systemd startup Broadway backend

Bug #1624783 reported by Ronald Skeoch
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu
Confirmed
Undecided
Unassigned

Bug Description

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:

[Unit]
Description=XXXXXXXXX
After=Our-Nginx.service

[Service]
ExecStart=/usr/bin/nodejs /path/to/Nodejs/application
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=Nodejs_application

[Install]
WantedBy=multi-user.target

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.LIBOVERLAY_SCROLLBAR = '';
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}`);
});

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your report. However, what made you file it against the ubuntu-docs package? (It's for the user documentation of the Ubuntu desktop.)

Possibly it's not a bug at all. I'd recommend that you ask for help at <http://askubuntu.com>.

affects: ubuntu-docs (Ubuntu) → ubuntu
Changed in ubuntu:
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
assignee: Gunnar Hjalmarsson (gunnarhj) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
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.