probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.22k stars 412 forks source link

Always runs with process named as "AppRun" #477

Open Pramod-Devireddy opened 3 years ago

Pramod-Devireddy commented 3 years ago

Hi, I tried to use linuxdeployqt for creating static qt applications without any dependencies. But when the final app (app_name-x86_64.AppImage) is executed, it always runs with the process name "AppRun".

I tried renaming and executed the app. But still, the process name doesn't change. The process name should be different to identify for getting stats or force kill a particular application. But when different applications are running with the same process name, it is very difficult to manage these apps.

probonopd commented 3 years ago

What are you using as your AppRun file/symlink? If you are using a script that execs the main payload, then the main payload should show up in ps as the process name.

Pramod-Devireddy commented 3 years ago

Hi @probonopd , thanks for replying back. It seems that AppRun is created as a symlink during the process. Please go through the following:

I am running the linuxdeployqt as ../linuxdeployqt-7-x86_64.AppImage app_name -appimage

Console Prints:

linuxdeployqt 6 (commit d41e234), build 724 built on 2020-07-31 15:51:47 UTC
Not using FHS-like mode
app-binary: "/home/Pramod/Downloads/app_name/app_name"
appDirPath: "/home/Pramod/Downloads/app_name"
relativeBinPath: "app_name"
WARNING: Plugin "/opt/Qt5.12.3/5.12.3/gcc_64/plugins/platformthemes/libqgtk2.so" not found, skipping
WARNING: Plugin "/opt/Qt5.12.3/5.12.3/gcc_64/plugins/styles/libqgtk2style.so" not found, skipping
appimagetool, continuous build (commit 0880085), build 2133 built on 2020-07-09 12:25:52 UTC
fatal: Not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Failed to run 'git rev-parse --short HEAD: Child process exited with code 128 (code 128)
Desktop file: /home/Pramod/Downloads/app_name/app_name.desktop
Name: app_name
Icon: app_name
Exec: app_name
Comment: Sample Qt App
Type: Application
Categories: Office;
/home/Pramod/Downloads/app_name/app_name used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libavahi-common.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libzmq.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-xinerama.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libprotobuf.so.12 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-randr.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Svg.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5PrintSupport.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libavahi-client.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5OpenGL.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libcrypt.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Widgets.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libfreebl3.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Gui.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libmysqlclient.so.18 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Sql.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libodbc.so.2 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Core.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libpq.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libicui18n.so.56 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libldap_r-2.4.so.2 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libicuuc.so.56 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/liblber-2.4.so.2 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libicudata.so.56 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libsasl2.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libgthread-2.0.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libssl3.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libXext.so.6 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libsmime3.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libpcre.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libnss3.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libXau.so.6 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libnssutil3.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5XcbQpa.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libplds4.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5DBus.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libplc4.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libX11-xcb.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libnspr4.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libXrender.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxkbcommon-x11.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxkbcommon.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libbz2.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libpng15.so.15 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libdbus-1.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-xkb.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libsystemd.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libcap.so.2 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libselinux.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/liblzma.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/liblz4.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libgcrypt.so.11 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libdw.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libattr.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libelf.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libicui18n.so.50 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libicuuc.so.50 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libicudata.so.50 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libpcre2-16.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libgraphite2.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5VirtualKeyboard.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-xfixes.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Quick.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Qml.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libQt5Network.so.5 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libssl.so.10 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libcrypto.so.10 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libgssapi_krb5.so.2 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libkrb5.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libk5crypto.so.3 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libkrb5support.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libkeyutils.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libXi.so.6 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-render-util.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-render.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-sync.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-image.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-shm.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-keysyms.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-icccm.so.4 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-shape.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-util.so.1 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libxcb-glx.so.0 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/lib/libcups.so.2 used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/platforms/libqxcb.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/iconengines/libqsvgicon.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqgif.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqicns.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqico.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqjpeg.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqsvg.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqtga.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqtiff.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqwbmp.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/imageformats/libqwebp.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/xcbglintegrations/libqxcb-egl-integration.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/xcbglintegrations/libqxcb-glx-integration.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/printsupport/libcupsprintersupport.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/sqldrivers/libqsqlite.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/sqldrivers/libqsqlmysql.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/sqldrivers/libqsqlodbc.so used for determining architecture x86_64
/home/Pramod/Downloads/app_name/plugins/sqldrivers/libqsqlpsql.so used for determining architecture x86_64
Using architecture x86_64
App name for filename: app_name
/home/Pramod/Downloads/app_name should be packaged as app_name-x86_64.AppImage
Generating squashfs...
Size of the embedded runtime: 188456 bytes
mksquashfs commandline: /tmp/.mount_linuxdIazf7j/usr/bin/../lib/appimagekit/mksquashfs /home/Pramod/Downloads/app_name app_name-x86_64.AppImage -offset 188456 -comp gzip -root-owned -noappend -mkfs-time 0 
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on app_name-x86_64.AppImage, block size 131072.
[======================================================================================================================================|] 1005/1005 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
    compressed data, compressed metadata, compressed fragments,
    compressed xattrs, compressed ids
    duplicates are removed
Filesystem size 46440.75 Kbytes (45.35 Mbytes)
    38.52% of uncompressed filesystem size (120553.82 Kbytes)
Inode table size 4604 bytes (4.50 Kbytes)
    44.15% of uncompressed inode table size (10428 bytes)
Directory table size 1455 bytes (1.42 Kbytes)
    49.86% of uncompressed directory table size (2918 bytes)
Xattr table size 85 bytes (0.08 Kbytes)
    83.33% of uncompressed xattr table size (102 bytes)
Number of duplicate files found 1
Number of inodes 122
Number of files 109
Number of fragments 27
Number of symbolic links  2
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 11
Number of ids (unique uids + gids) 1
Number of uids 1
    root (0)
Number of gids 1
    root (0)
Embedding ELF...
Marking the AppImage as executable...
Embedding MD5 digest
Success

Please consider submitting your AppImage to AppImageHub, the crowd-sourced
central directory of available AppImages, by opening a pull request
at https://github.com/AppImage/appimage.github.io

Files & Folders Generated:

-rwxrwx---. 1 Pramod Pramod    45762 Sep 24 14:07 app_name.png
-rwxrwxr-x. 1 Pramod Pramod  1979592 Mar  6 09:58 app_name
-rw-rw-r--. 1 Pramod Pramod      116 Mar  7 18:29 app_name.desktop
lrwxrwxrwx. 1 Pramod Pramod        8 Mar  7 18:37 AppRun -> app_name
drwxrwxr-x. 9 Pramod Pramod      154 Mar  7 18:37 plugins
drwxrwxr-x. 2 Pramod Pramod     4096 Mar  7 18:37 lib
-rw-rw-r--. 1 Pramod Pramod      145 Mar  7 18:37 qt.conf
drwxrwxr-x. 2 Pramod Pramod        6 Mar  7 18:37 translations
-rwxr-xr-x. 1 Pramod Pramod 47747112 Mar  7 18:37 app_name-x86_64.AppImage

When the executable app_name-x86_64.AppImage is executed simply as ./app_name-x86_64.AppImage

The app started as expected but it is creating two processes

  1. AppRun
  2. app_name-x86_64

But the process with the name app_name-x86_64 is looking like some dummy process. Because there is no change in CPU or memory (always 0%) when some action is done in the application. Only AppRun is responding to any actions or computations performed in the app. Even if app_name-x86_64 is force killed, the application still runs normally. But when AppRun is killed the application gets terminated.

System Environment:

NAME="Red Hat Enterprise Linux Server"
VERSION="7.8 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.8"
PRETTY_NAME="Red Hat Enterprise Linux"
probonopd commented 3 years ago

It seems that AppRun is created as a symlink during the process.

Correct. You'd need to delete that symlink and replace it with something that execs your main payload application. I know no other way to make this work as intended.