Giter VIP home page Giter VIP logo

Comments (5)

Alysko avatar Alysko commented on July 19, 2024

Not a good solution (I think variable substitution is made after). Prefer:
sudo bash -c 'cat > /etc/systemd/system/nvoc.service' << EOF ...

And brackets are useless {$HOME} -> $HOME.

from nvoc_by_fullzero_community_release.

LuKePicci avatar LuKePicci commented on July 19, 2024

Variables substitution is made while installing the service, ie while executing 'bash nvOC install-service'. What's the difference between the two approaches?

from nvoc_by_fullzero_community_release.

Alysko avatar Alysko commented on July 19, 2024

First just doesn't work. variables stay empty. In second version, substitution is done.

from nvoc_by_fullzero_community_release.

LuKePicci avatar LuKePicci commented on July 19, 2024

I can't reproduce your situation. I just mad this script write into ./test.txt instead of the actual nvoc.service file and this is what happened:

m1@m1-desktop:/nvOC-git$ bash nvOC install-service
m1@m1-desktop:/ nvOC install-service
Reinstalling nvOC service for /home/m1/nvOC-git
Setting ACL for 'nvoc' service user write access to NVOC path...
Done.\e[0m This service has autostart enabled.
m1@m1-desktop:/nvOC-git$ cat test.txt
[Unit]
Description=nvOC Service

[Service]
Type=forking
User=nvoc

Environment=GPU_FORCE_64BIT_PTR=0
Environment=GPU_MAX_HEAP_SIZE=100
Environment=GPU_USE_SYNC_OBJECTS=1
Environment=GPU_MAX_ALLOC_PERCENT=100
Environment=GPU_SINGLE_ALLOC_PERCENT=100

Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/m1/.Xauthority
Environment=NVOC=/home/m1/nvOC-git

WorkingDirectory=/home/m1/nvOC-git
ExecStart=/usr/bin/screen -c /home/m1/nvOC-git/screenrc-main -dmSL main /bin/bash "/home/m1/nvOC-git/2unix"
Restart=always
m1@m1-desktop:~/nvOC-git$

As you can see variables substitution is working.

from nvoc_by_fullzero_community_release.

LuKePicci avatar LuKePicci commented on July 19, 2024

I'll now commit your alternative in any case, since it's working as well.

from nvoc_by_fullzero_community_release.

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.