UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    how to setup systemd script in clickable project directory ?

    Scheduled Pinned Locked Moved App Development
    8 Posts 2 Posters 748 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • D Offline
        ds2k5
        last edited by

        @lduboeuf

        Hi Lionel,
        I did not understand how to build
        a systemd script in the Source Code dirertory
        that after build a click file an install it with clickable
        the systemd script is available and started.

        I like to Port the: Upower Indicator (for UB 1604) from open-store

        but did not understand how to build the scripts

        I converted the APP so far that I can build the APP for
        UB 20.04. But found some errors.

        the orginal service file is this:

        <?xml version="1.0" encoding="UTF-8"?>
        <service id="indicator.upower.ernesst_indicator-upower">
          <type>webapps</type>
          <name>indicator-upower</name>
          <provider>indicator-upower</provider>
        </service>
        

        my try for new version is this:

        [Unit]
        Description=indicator upower
        
        [Service]
        EnvironmentFile=/home/phablet/.config/indicator.upower.ernesst/indicator.upower.ernesst.conf
        ExecStart=/home/phablet/.local/share/indicator.upower.ernesst/indicator-upower
        
        
        [Install]
        WantedBy=graphical-session.target
        

        and I tyed to mod the indicator-upower-helper
        but busybox did not include "cp" command

        [28.10.24 06:51] library "eglSubDriverAndroid.so" not found
        [28.10.24 06:51] Creating a QMirClientScreen now
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:516:15: QML Label: Cannot anchor to an item that isn't a parent or sibling.
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:516:15: QML Label: Cannot anchor to an item that isn't a parent or sibling.
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:368:15: QML Label: Cannot anchor to an item that isn't a parent or sibling.
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:368:15: QML Label: Cannot anchor to an item that isn't a parent or sibling.
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:495:19: Unable to assign [undefined] to int
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:510:19: Unable to assign [undefined] to int
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:539:19: Unable to assign [undefined] to int
        [28.10.24 06:51] file:///opt/click.ubuntu.com/indicator.upower.ernesst/0.3/qml/Main.qml:554:19: Unable to assign [undefined] to int
        [28.10.24 06:52] QObject::startTimer: Timers cannot be started from another thread
        [28.10.24 06:54] qt.qpa.mirclient: Attempted to deliver an event to a non-existent window, ignoring.
        [28.10.24 06:54] qt.qpa.mirclient: Attempted to deliver an event to a non-existent window, ignoring.
        [28.10.24 06:54] qt.qpa.mirclient: Attempted to deliver an event to a non-existent window, ignoring.
        
        lduboeufL 2 Replies Last reply Reply Quote 0
        • lduboeufL Offline
          lduboeuf @ds2k5
          last edited by lduboeuf

          @ds2k5 can you share the link to the source code repository ?

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            ds2k5 @lduboeuf
            last edited by ds2k5

            @lduboeuf

            https://gitlab.com/ubtouch2/fork-indicator-upower

            1 Reply Last reply Reply Quote 0
            • lduboeufL Offline
              lduboeuf @ds2k5
              last edited by

              @ds2k5 you will have to adapt install.sh, uninstall.sh to copy the service file to user systemd directory ( /home/phablet/.config/systemd/user/ )

              D 2 Replies Last reply Reply Quote 0
              • D Offline
                ds2k5 @lduboeuf
                last edited by

                @lduboeuf

                I will try thank you so much!

                How to fix the issue:

                [27.10.24 21:42] library "eglSubDriverAndroid.so" not found
                

                more see above

                1 Reply Last reply Reply Quote 0
                • D Offline
                  ds2k5 @lduboeuf
                  last edited by

                  @lduboeuf

                  how to set that the .sh scripts are executable
                  because in source file they are
                  But on the device after install by clickable they not executable:

                  -rw-r--r-- 1 clickpkg clickpkg  555 Oct 28 11:20 install.sh
                  -rw-r--r-- 1 clickpkg clickpkg  262 Oct 28 11:42 uninstall.sh
                  
                  lduboeufL 1 Reply Last reply Reply Quote 0
                  • lduboeufL Offline
                    lduboeuf @ds2k5
                    last edited by

                    @ds2k5 said in how to setup systemd script in clickable project directory ?:

                    @lduboeuf

                    how to set that the .sh scripts are executable
                    because in source file they are
                    But on the device after install by clickable they not executable:

                    -rw-r--r-- 1 clickpkg clickpkg  555 Oct 28 11:20 install.sh
                    -rw-r--r-- 1 clickpkg clickpkg  262 Oct 28 11:42 uninstall.sh
                    

                    it is done by code: https://gitlab.com/ubtouch2/fork-indicator-upower/-/blob/main/plugins/Indicator/indicator.cpp#L19

                    D 1 Reply Last reply Reply Quote 0
                    • D Offline
                      ds2k5 @lduboeuf
                      last edited by

                      @lduboeuf

                      thanks

                      1 Reply Last reply Reply Quote 0
                      • CiberSheepC CiberSheep moved this topic from General on

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post