Giter VIP home page Giter VIP logo

Comments (7)

rfrail3 avatar rfrail3 commented on July 22, 2024

It's not neccesary, I picked up root for avoid than the other users modified the data base file.

Do you consider right the creation of an user "tuptime"? There is no problem.

from tuptime.

anarcat avatar anarcat commented on July 22, 2024

we could create a tuptime user, of course, in the debian package. this is fairly standard procedure.

i just wonder what would happen if a regular user would run tuptime without write access to the database - won't sqlite try to lock it and fail?

from tuptime.

rfrail3 avatar rfrail3 commented on July 22, 2024

That scenario is covered, only the user that have write permission can upload the database registers, any other unprivileged user can only read it, but both will have the same values.

For example, if tuptime was installed with root and you run it with a normal user enabling verbose mode, these two lines are printed:

WARNING values not saved into db - Test file permissions
WARNING attempt to write a readonly database

But, the values are updated internally in python execution without writing anyting. The only exception is the first execution after a startup. In that case, if you do the same, the message is:

ERROR After system restart, the values must be saved into db. Please, execute tuptime with a privileged user.

But it is a uncommon case, because if the init manager execute it, any user fall in the example case at the top.

from tuptime.

anarcat avatar anarcat commented on July 22, 2024

right, okay. i will let you do a release then will work on creating a user in the debian package.

you can also do it yourself if you wish. i think it should only be a matter of changing the cron job, the service file, and adding/removing a user in the debian/post* scripts. A recent example of this in a debian package i maintain is willie:

https://sources.debian.net/src/willie/5.5.1-1/debian/postrm/#L28
https://sources.debian.net/src/willie/5.5.1-1/debian/postrm/#L28
https://sources.debian.net/src/willie/5.5.1-1/debian/init.d/#L50

note that, in the debian package, you may want to ship the init.d file properly as well, to support users who do not wish to run systemd, which is still supported in debian...

from tuptime.

rfrail3 avatar rfrail3 commented on July 22, 2024

Off course, let me the time for do it...

from tuptime.

anarcat avatar anarcat commented on July 22, 2024

no problem, of course. :)

from tuptime.

rfrail3 avatar rfrail3 commented on July 22, 2024

Hi Anarcat,

It's done, please, review it.

Thanks!

from tuptime.

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.