systemdâÂÂs syntax to pass a parameter
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
-1
down vote
favorite
How can I get the present path as the parameter? And how can I pass this parameter to the ExecStart?
[Unit]
Description="xxxxxxx"
[Service]
EnvironmentFile='WORKDIR=/home/aaaa/bbbbb/' #I want to get this path dynamically when I put this in another path.
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:/home/aaaa/bbbbb/cfg.json
ExecStop=/bin/sleep 5
KillMode=process
KillSignal=SIGQUIT
Restart=always
RestartSec=5s
LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitNPROC=64000
TasksMax=infinity
TasksAccounting=false
[Install]
WantedBy=multi-user.target
systemd
 |Â
show 6 more comments
up vote
-1
down vote
favorite
How can I get the present path as the parameter? And how can I pass this parameter to the ExecStart?
[Unit]
Description="xxxxxxx"
[Service]
EnvironmentFile='WORKDIR=/home/aaaa/bbbbb/' #I want to get this path dynamically when I put this in another path.
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:/home/aaaa/bbbbb/cfg.json
ExecStop=/bin/sleep 5
KillMode=process
KillSignal=SIGQUIT
Restart=always
RestartSec=5s
LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitNPROC=64000
TasksMax=infinity
TasksAccounting=false
[Install]
WantedBy=multi-user.target
systemd
Welcome to Ask Ubuntu! Please describe what you are actually trying to achieve, your question looks pretty unclear. Please make the title of your question more specific: âÂÂquestion aboutâ â well, every question here is a question, âÂÂthe systemdâ â systemd does a lot of things⦠Are you trying to set up a service (just guessing)? Using appropriate tags would also help to get your question answered.
â Melebius
Jun 11 at 9:08
What do you mean by "the" current directory? Each and every process has its own current working directory.
â AlexP
Jun 11 at 9:52
@AlexP it means my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 11:21
In what language is yourserver
written? Is it a (wrapper-)script? Would be great if it was.
â PerlDuck
Jun 11 at 11:47
@PerlDuck it is written by nim,and compiled it to a executable file of binary.
â Jimmy
Jun 11 at 11:55
 |Â
show 6 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
How can I get the present path as the parameter? And how can I pass this parameter to the ExecStart?
[Unit]
Description="xxxxxxx"
[Service]
EnvironmentFile='WORKDIR=/home/aaaa/bbbbb/' #I want to get this path dynamically when I put this in another path.
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:/home/aaaa/bbbbb/cfg.json
ExecStop=/bin/sleep 5
KillMode=process
KillSignal=SIGQUIT
Restart=always
RestartSec=5s
LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitNPROC=64000
TasksMax=infinity
TasksAccounting=false
[Install]
WantedBy=multi-user.target
systemd
How can I get the present path as the parameter? And how can I pass this parameter to the ExecStart?
[Unit]
Description="xxxxxxx"
[Service]
EnvironmentFile='WORKDIR=/home/aaaa/bbbbb/' #I want to get this path dynamically when I put this in another path.
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:/home/aaaa/bbbbb/cfg.json
ExecStop=/bin/sleep 5
KillMode=process
KillSignal=SIGQUIT
Restart=always
RestartSec=5s
LimitFSIZE=infinity
LimitCPU=infinity
LimitAS=infinity
LimitNOFILE=64000
LimitNPROC=64000
TasksMax=infinity
TasksAccounting=false
[Install]
WantedBy=multi-user.target
systemd
edited Jun 11 at 12:00
Melebius
3,58741636
3,58741636
asked Jun 11 at 7:52
![](https://lh6.googleusercontent.com/-zrQy-p85vxQ/AAAAAAAAAAI/AAAAAAAAAJY/bz_97zCl_s0/photo.jpg?sz=32)
![](https://lh6.googleusercontent.com/-zrQy-p85vxQ/AAAAAAAAAAI/AAAAAAAAAJY/bz_97zCl_s0/photo.jpg?sz=32)
Jimmy
12
12
Welcome to Ask Ubuntu! Please describe what you are actually trying to achieve, your question looks pretty unclear. Please make the title of your question more specific: âÂÂquestion aboutâ â well, every question here is a question, âÂÂthe systemdâ â systemd does a lot of things⦠Are you trying to set up a service (just guessing)? Using appropriate tags would also help to get your question answered.
â Melebius
Jun 11 at 9:08
What do you mean by "the" current directory? Each and every process has its own current working directory.
â AlexP
Jun 11 at 9:52
@AlexP it means my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 11:21
In what language is yourserver
written? Is it a (wrapper-)script? Would be great if it was.
â PerlDuck
Jun 11 at 11:47
@PerlDuck it is written by nim,and compiled it to a executable file of binary.
â Jimmy
Jun 11 at 11:55
 |Â
show 6 more comments
Welcome to Ask Ubuntu! Please describe what you are actually trying to achieve, your question looks pretty unclear. Please make the title of your question more specific: âÂÂquestion aboutâ â well, every question here is a question, âÂÂthe systemdâ â systemd does a lot of things⦠Are you trying to set up a service (just guessing)? Using appropriate tags would also help to get your question answered.
â Melebius
Jun 11 at 9:08
What do you mean by "the" current directory? Each and every process has its own current working directory.
â AlexP
Jun 11 at 9:52
@AlexP it means my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 11:21
In what language is yourserver
written? Is it a (wrapper-)script? Would be great if it was.
â PerlDuck
Jun 11 at 11:47
@PerlDuck it is written by nim,and compiled it to a executable file of binary.
â Jimmy
Jun 11 at 11:55
Welcome to Ask Ubuntu! Please describe what you are actually trying to achieve, your question looks pretty unclear. Please make the title of your question more specific: âÂÂquestion aboutâ â well, every question here is a question, âÂÂthe systemdâ â systemd does a lot of things⦠Are you trying to set up a service (just guessing)? Using appropriate tags would also help to get your question answered.
â Melebius
Jun 11 at 9:08
Welcome to Ask Ubuntu! Please describe what you are actually trying to achieve, your question looks pretty unclear. Please make the title of your question more specific: âÂÂquestion aboutâ â well, every question here is a question, âÂÂthe systemdâ â systemd does a lot of things⦠Are you trying to set up a service (just guessing)? Using appropriate tags would also help to get your question answered.
â Melebius
Jun 11 at 9:08
What do you mean by "the" current directory? Each and every process has its own current working directory.
â AlexP
Jun 11 at 9:52
What do you mean by "the" current directory? Each and every process has its own current working directory.
â AlexP
Jun 11 at 9:52
@AlexP it means my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 11:21
@AlexP it means my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 11:21
In what language is your
server
written? Is it a (wrapper-)script? Would be great if it was.â PerlDuck
Jun 11 at 11:47
In what language is your
server
written? Is it a (wrapper-)script? Would be great if it was.â PerlDuck
Jun 11 at 11:47
@PerlDuck it is written by nim,and compiled it to a executable file of binary.
â Jimmy
Jun 11 at 11:55
@PerlDuck it is written by nim,and compiled it to a executable file of binary.
â Jimmy
Jun 11 at 11:55
 |Â
show 6 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
Systemd doesn't make the working directory accessible via specifiers, nor can you use environment variables in setting WorkingDirectory
. You can use environment variables in ExecStart
, but not for the command path. So, unless you use workarounds, you will have to specify the path at least thrice (note that you want Environment=
, not EnvironmentFile=
):
Environment='WORKDIR=/home/aaaa/bbbbb'
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:$WORKDIR/cfg.json
Or, wrap your command in sh
instead:
Environment='WORKDIR=/home/aaaa/bbbbb'
ExecStart=/bin/sh -c 'cd $WORKDIR; exec $WORKDIR/server --database:$WORKDIR/cfg.json'
(Hopefully your WORKDIR
doesn't include spaces or other special characters in it.)
Or, if you make the unit a template, you can do:
Environment='WORKDIR=/%I'
WorkingDirectory=/%I
ExecStart=/%I/server --database:/%I/cfg.json
And do something like:
systemctl --user start my-service@home/aaaa/bbbbb.service
Note the leading slash /
before the %I
. The path to the executable must be absolute, with or without specifiers, so we need to use /%I
.
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
@Jimmy So you are asking how to get the current working directory from within yourbbbb
script? Look at thecwd
/getcwd()
function and/or environment variable$PWD
.
â PerlDuck
Jun 11 at 10:27
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
 |Â
show 3 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Systemd doesn't make the working directory accessible via specifiers, nor can you use environment variables in setting WorkingDirectory
. You can use environment variables in ExecStart
, but not for the command path. So, unless you use workarounds, you will have to specify the path at least thrice (note that you want Environment=
, not EnvironmentFile=
):
Environment='WORKDIR=/home/aaaa/bbbbb'
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:$WORKDIR/cfg.json
Or, wrap your command in sh
instead:
Environment='WORKDIR=/home/aaaa/bbbbb'
ExecStart=/bin/sh -c 'cd $WORKDIR; exec $WORKDIR/server --database:$WORKDIR/cfg.json'
(Hopefully your WORKDIR
doesn't include spaces or other special characters in it.)
Or, if you make the unit a template, you can do:
Environment='WORKDIR=/%I'
WorkingDirectory=/%I
ExecStart=/%I/server --database:/%I/cfg.json
And do something like:
systemctl --user start my-service@home/aaaa/bbbbb.service
Note the leading slash /
before the %I
. The path to the executable must be absolute, with or without specifiers, so we need to use /%I
.
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
@Jimmy So you are asking how to get the current working directory from within yourbbbb
script? Look at thecwd
/getcwd()
function and/or environment variable$PWD
.
â PerlDuck
Jun 11 at 10:27
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
 |Â
show 3 more comments
up vote
1
down vote
Systemd doesn't make the working directory accessible via specifiers, nor can you use environment variables in setting WorkingDirectory
. You can use environment variables in ExecStart
, but not for the command path. So, unless you use workarounds, you will have to specify the path at least thrice (note that you want Environment=
, not EnvironmentFile=
):
Environment='WORKDIR=/home/aaaa/bbbbb'
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:$WORKDIR/cfg.json
Or, wrap your command in sh
instead:
Environment='WORKDIR=/home/aaaa/bbbbb'
ExecStart=/bin/sh -c 'cd $WORKDIR; exec $WORKDIR/server --database:$WORKDIR/cfg.json'
(Hopefully your WORKDIR
doesn't include spaces or other special characters in it.)
Or, if you make the unit a template, you can do:
Environment='WORKDIR=/%I'
WorkingDirectory=/%I
ExecStart=/%I/server --database:/%I/cfg.json
And do something like:
systemctl --user start my-service@home/aaaa/bbbbb.service
Note the leading slash /
before the %I
. The path to the executable must be absolute, with or without specifiers, so we need to use /%I
.
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
@Jimmy So you are asking how to get the current working directory from within yourbbbb
script? Look at thecwd
/getcwd()
function and/or environment variable$PWD
.
â PerlDuck
Jun 11 at 10:27
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
 |Â
show 3 more comments
up vote
1
down vote
up vote
1
down vote
Systemd doesn't make the working directory accessible via specifiers, nor can you use environment variables in setting WorkingDirectory
. You can use environment variables in ExecStart
, but not for the command path. So, unless you use workarounds, you will have to specify the path at least thrice (note that you want Environment=
, not EnvironmentFile=
):
Environment='WORKDIR=/home/aaaa/bbbbb'
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:$WORKDIR/cfg.json
Or, wrap your command in sh
instead:
Environment='WORKDIR=/home/aaaa/bbbbb'
ExecStart=/bin/sh -c 'cd $WORKDIR; exec $WORKDIR/server --database:$WORKDIR/cfg.json'
(Hopefully your WORKDIR
doesn't include spaces or other special characters in it.)
Or, if you make the unit a template, you can do:
Environment='WORKDIR=/%I'
WorkingDirectory=/%I
ExecStart=/%I/server --database:/%I/cfg.json
And do something like:
systemctl --user start my-service@home/aaaa/bbbbb.service
Note the leading slash /
before the %I
. The path to the executable must be absolute, with or without specifiers, so we need to use /%I
.
Systemd doesn't make the working directory accessible via specifiers, nor can you use environment variables in setting WorkingDirectory
. You can use environment variables in ExecStart
, but not for the command path. So, unless you use workarounds, you will have to specify the path at least thrice (note that you want Environment=
, not EnvironmentFile=
):
Environment='WORKDIR=/home/aaaa/bbbbb'
WorkingDirectory=/home/aaaa/bbbbb
ExecStart=/home/aaaa/bbbbb/server --database:$WORKDIR/cfg.json
Or, wrap your command in sh
instead:
Environment='WORKDIR=/home/aaaa/bbbbb'
ExecStart=/bin/sh -c 'cd $WORKDIR; exec $WORKDIR/server --database:$WORKDIR/cfg.json'
(Hopefully your WORKDIR
doesn't include spaces or other special characters in it.)
Or, if you make the unit a template, you can do:
Environment='WORKDIR=/%I'
WorkingDirectory=/%I
ExecStart=/%I/server --database:/%I/cfg.json
And do something like:
systemctl --user start my-service@home/aaaa/bbbbb.service
Note the leading slash /
before the %I
. The path to the executable must be absolute, with or without specifiers, so we need to use /%I
.
answered Jun 11 at 10:01
muru
128k19269459
128k19269459
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
@Jimmy So you are asking how to get the current working directory from within yourbbbb
script? Look at thecwd
/getcwd()
function and/or environment variable$PWD
.
â PerlDuck
Jun 11 at 10:27
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
 |Â
show 3 more comments
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
@Jimmy So you are asking how to get the current working directory from within yourbbbb
script? Look at thecwd
/getcwd()
function and/or environment variable$PWD
.
â PerlDuck
Jun 11 at 10:27
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
but i need to get the current directory dynamically
â Jimmy
Jun 11 at 10:17
@Jimmy So you are asking how to get the current working directory from within your
bbbb
script? Look at the cwd
/getcwd()
function and/or environment variable $PWD
.â PerlDuck
Jun 11 at 10:27
@Jimmy So you are asking how to get the current working directory from within your
bbbb
script? Look at the cwd
/getcwd()
function and/or environment variable $PWD
.â PerlDuck
Jun 11 at 10:27
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
my fault,bbbbb also part of the path.i just want to get the current directory dynamically in this xxxx.service
â Jimmy
Jun 11 at 10:30
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
@Jimmy get it where? Why is it dynamic?
â muru
Jun 11 at 10:45
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
cause my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 10:52
 |Â
show 3 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045523%2fsystemd-s-syntax-to-pass-a-parameter%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Welcome to Ask Ubuntu! Please describe what you are actually trying to achieve, your question looks pretty unclear. Please make the title of your question more specific: âÂÂquestion aboutâ â well, every question here is a question, âÂÂthe systemdâ â systemd does a lot of things⦠Are you trying to set up a service (just guessing)? Using appropriate tags would also help to get your question answered.
â Melebius
Jun 11 at 9:08
What do you mean by "the" current directory? Each and every process has its own current working directory.
â AlexP
Jun 11 at 9:52
@AlexP it means my whole backend might not be deployed under /home/aaaa/bbbbb/ this path when i deliver to the customer.so i want to get the current directory dynamically in this xxxx.service that i can make a soft link from /lib/systemd/system to here.
â Jimmy
Jun 11 at 11:21
In what language is your
server
written? Is it a (wrapper-)script? Would be great if it was.â PerlDuck
Jun 11 at 11:47
@PerlDuck it is written by nim,and compiled it to a executable file of binary.
â Jimmy
Jun 11 at 11:55