Giter VIP home page Giter VIP logo

Comments (5)

tobychui avatar tobychui commented on August 21, 2024

Hi @radim-ek , thanks for the feedback. I am not too familiar with bash scripting. I am thinking if there are any better ways to do it other than including apt-get install sudo into the installer script.
You got any recommended way for me to improve it?

from arozos.

Morethanevil avatar Morethanevil commented on August 21, 2024

Those lines are for the systemd service. You can create this yourself easily. Run the installscript and ignore the warnings. Now run create a new service file as root:

nano /etc/systemd/system/arozos.service

Put in these lines to run arozos:

[Unit]
Description=ArozOS Cloud Service
After=systemd-networkd-wait-online.service
Wants=systemd-networkd-wait-online.service

[Service]
Type=simple
ExecStartPre=/bin/sleep 10
WorkingDirectory=/home/${CURRENT_USER}/arozos/
ExecStart=/bin/bash /home/${CURRENT_USER}/arozos/start.sh

Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Now (still as root) start Arozos with:

systemctl enable --now arozos.service

You can check the status with:

systemctl status arozos.service

from arozos.

neonspectra avatar neonspectra commented on August 21, 2024

@tobychui A highly portable drop-in replacement for using sudo (if you really need root) is:

su - root -c "yourcommand"

Explanation:

  • su - switch user, the most absolutely basic way to be a different user on a Unix based OS
  • - - Start a login shell
  • root - The user we want to run our thing as
  • -c - Flag to run a command under the specific user in the login shell we opened

Note: it's still possible for this to not work if the system you're running on doesn't have root access at all, like some weird ARM stuff (which is I think the target for a lot of this project). But that's probably outside the scope of troubleshooting and if someone runs into that issue, they need to root their device.


Also, it's generally better practice to use sudo than su since you can't enforce granular permissions via sudoers in su the way you can via sudo. Best practice, however, is to not require root.

from arozos.

tobychui avatar tobychui commented on August 21, 2024

@neonspectra Thanks for the tips.
In fact ArozOS can work without root, but if that is the case, it pretty much just serve as a web desktop interface like other front-end only projects. To run arozos without root, just download the web.tar.gz and the executable into any folder and run it with ./arozos.

Root access is required for disk management (SMART / disk mounting), WiFi utilities and more to make ArozOS useful so to say. Though, making the installer sudo optional is not a high priority task so I just leave this here for now. As usual, PRs are welcomed!

from arozos.

tobychui avatar tobychui commented on August 21, 2024

Closing issue as the fixes has been merged

from arozos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.