• 𝕸𝖔𝖘𝖘@infosec.pub
    link
    fedilink
    English
    arrow-up
    76
    ·
    13 hours ago

    I’ve found out the hard way: Running the script during startup, and running it using the proper user authorization, are two different things.

      • bleistift2@sopuli.xyzOP
        link
        fedilink
        English
        arrow-up
        11
        ·
        10 hours ago

        You’re right and I’m dumb. I forgot to absolute-ify one of the paths, which caused the script to be dependent on my user environment, which isn’t loaded by the desktop file.

      • bleistift2@sopuli.xyzOP
        link
        fedilink
        English
        arrow-up
        13
        ·
        12 hours ago

        Knowing that the environment is finicky, I made sure to only use absolute paths to all files and executables.

        But thanks for the hint.

        • ogeist@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          11 hours ago

          What are you using as a Desktop Environment? Certain with DEs the Autostart programs need to be added in the config file.

            • ogeist@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              11 hours ago

              According to the Arch Wiki you need to place the .desktop file in:

              ~/.config/autostart/*****.desktop
              

              You also need to add the following line to the .desktop file:

              X-GNOME-Autostart-enabled=true
              

              But that’s probably the hard way to do it, I think the settings panel should also have a Startup Application tab.

              • bleistift2@sopuli.xyzOP
                link
                fedilink
                English
                arrow-up
                1
                ·
                11 hours ago

                Thanks for looking that up. That’s where my desktop file is located. And it has the X-GNOME-Autostart-enabled=true line. The settings panel does have a Startup Application tab, and that’s what I used. It created the .desktop file in the appropriate location.

                • ogeist@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  11 hours ago

                  surprised_pikachu_face.jpeg

                  Check your journald and/or make your script log it’s actions.

                  Script > ~/script.log
                  
  • RoyaltyInTraining@lemmy.world
    link
    fedilink
    arrow-up
    29
    ·
    12 hours ago

    Weird that it doesn’t work. The usual way to run scripts on startup is through systemd units though. That has the added benefits of automatically logging all output and letting you control it through commands like systemctl enable <unit name>. It’s a really neat system, and I highly recommend learning it if you see yourself doing this kind of automation more often.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      13 hours ago

      Though, not every cron supports that.

      Also, if you are packaging software, you have to do it the right way. But if not, it’s often easier to go and install an init script.

        • marcos@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          12 hours ago

          It’s not broken. You just have to get a cron that supports it. Debian has at least one that does, but it’s not the default one.

    • bleistift2@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      12 hours ago

      Thanks. man 5 crontab says the @reboot syntax is supported, so I’ll give that a try if I don’t stumble upon a different solution.

      • Snot Flickerman@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        11
        ·
        edit-2
        12 hours ago

        Just to make sure it pops off after fully starting up. I run a lot of old hardware, so it’s useful for me. You may not need a delay.

    • bleistift2@sopuli.xyzOP
      link
      fedilink
      English
      arrow-up
      12
      ·
      edit-2
      13 hours ago

      Indeed, I made this meme from memory and got the extension wrong.

      I corrected the meme. Thanks for pointing out the error

  • mindbleach@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    12 hours ago

    “Can you mount the /media/user/Backup drive on startup?”

    “Sure.”

    “… where is it?”

    “Somewhere else.”

  • majiks@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    9 hours ago

    gnome-terminal -- sh -c "my_command" This will open that command in new terminal window at login