Jump to content
View in the app

A better way to browse. Learn more.

Pulseway

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Workflow hangs when executing shell command on ubuntu despite command executing

Posted

Hello,

Just want to preface this by saying I’m fairly new to SysAdmin work. That said, I appreciate any insight and would kindly ask if replies could avoid assuming too much context. :)

I was tasked with opening a specific URL on every machine in the domain at a scheduled time. I set up a workflow (currently running only on manual starts from the Automation Hub) as follows:

  1. Windows: Start-Process "explorer.exe" "[URL]"

  2. macOS: open "[URL]"

  3. Linux (Ubuntu 24 test machine): see below

On Windows and macOS, the commands work perfectly and the workflow ends as soon as the browser launches.

On Linux, however, I ran into issues. The Pulseway agent always seems to execute commands as root (even when the “Run as logged in user” option is selected).

image.png

I tried running the command as the seat0 user with runuser -u, but Firefox/xdg-open wasn’t inheriting $DISPLAY/$WAYLAND_DISPLAY, $XDG_RUNTIME_DIR, and $DBUS_SESSION_BUS_ADDRESS correctly.

After a lot of band-aid fixing, I ended up with this super scuffed one-liner (I am aware this is probably very suboptimal, but it at least launches Firefox so I'm not touching it until I know more):

U=$(loginctl list-sessions --no-legend | awk '$4=="seat0" && $3!="gdm" && $3!="lightdm"{print $3; exit}'); if [ -n "$U" ]; then UID=$(id -u "$U");
(runuser -u "$U" -- bash -c '((
env WAYLAND_DISPLAY=wayland-0 
XDG_RUNTIME_DIR=/run/user/'"$UID"' 
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/'"$UID"'/bus
/usr/bin/firefox --no-remote --new-instance --new-window --start-maximized "[URL]"
>/dev/null 2>&1) &) & disown'); fi; exit 0

This does successfully launch Firefox with the URL, but the workflow action hangs for ~30 minutes (until max execution time hits, currently set to 1h).

I’ve tried:

  • >/dev/null 2>&1 &

  • nohup

  • disown

  • spawning a subshell and exiting it in hopes that would trigger the pulseway agent to get a kind of "command executed" signal.

But nothing has worked, the workflow still hangs instead of completing once the command is handed off.

So I think I’m misunderstanding something fundamental either about Linux process handling, or how Pulseway agents execute/track Linux commands within workflows.
Happy to provide any further information if needed, thank you in advance!

Veljko (Max)

Edited by Veljko

Featured Replies

  • Administrators

Hey @Veljko - Thanks for reaching out! I'm going to raise a ticket to our support team about this and they'll be able to assist you here☺️

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.