You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/05/13 22:03:37 UTC

[GitHub] [apisix] Yiyiyimu opened a new pull request #4246: chore: fix apisix could not be called to run in non-apisix dir

Yiyiyimu opened a new pull request #4246:
URL: https://github.com/apache/apisix/pull/4246


   Signed-off-by: yiyiyimu <wo...@gmail.com>
   
   ### What this PR does / why we need it:
   fix #4243 
   
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] starsz commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r633510621



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       Installed in other methods, maybe don't have `apisix.service` in the file system.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r633059994



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       I think you should use path in the file system, not the relative one in the build tool repo.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on pull request #4246: chore: fix apisix could not be called to run in non-apisix dir

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#issuecomment-840948177


   > This file can be in https://github.com/api7/apisix-build-tools? Since our RPM package has a fixed installation path, this file can be simpler.
   
   Sure that's a good idea to automate installing the unit file. I'll also add a link here in maybe `how-to-build.md` to give people instruction in case they do not build with rpm packages


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r632975760



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       Bad path




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r632997089



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       The path would work when PR in api7 merged.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on pull request #4246: chore: fix apisix could not be called to run in non-apisix dir

Posted by GitBox <gi...@apache.org>.
spacewander commented on pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#issuecomment-840924970


   What about setting `$PWD` to /usr/local/apisix?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r632997089



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       The path would work when PR in api7 merged.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#issuecomment-841605802


   @spacewander PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r634083905



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       @Yiyiyimu 
   Actually, I mean the service file should be put into the deployed machine's `/usr/lib/systemd/system/apisix.service`, but not in this repo.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r634716684



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       > Actually, I mean the service file should be put into the deployed machine's /usr/lib/systemd/system/apisix.service, but not in this repo.
   
   lol got it 🤣 fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #4246: chore: fix apisix could not be called to run in non-apisix dir

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r632192696



##########
File path: apisix/cli/apisix.lua
##########
@@ -25,7 +25,7 @@ local pkg_path = apisix_home .. "/deps/share/lua/5.1/?.lua;"
 
 -- modify the load path to load our dependencies
 package.cpath = pkg_cpath .. pkg_cpath_org
-package.path  = pkg_path .. pkg_path_org
+package.path  = pkg_path .. pkg_path_org .. ";" .. apisix_home .. "/?.lua"

Review comment:
       It's not a good idea. What if people try to install APISIX to another directory instead of `/usr/local/apisix`, like `/usr/share/lua/5.1`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on pull request #4246: chore: fix apisix could not be called to run in non-apisix dir

Posted by GitBox <gi...@apache.org>.
spacewander commented on pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#issuecomment-840934860


   This file can be in https://github.com/api7/apisix-build-tools? Since our RPM package has a fixed installation path, this file can be simpler.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on pull request #4246: chore: fix apisix could not be called to run in non-apisix dir

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#issuecomment-840934010


   > What about setting `$PWD` to /usr/local/apisix?
   
   Yes that would be better. I'll try to find a place to add the systemd unit file template to doc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r633850431



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       > I think you should use path in the file system, not the relative one in the build tool repo.
   
   Got it. Also add a note to indicate another copy exists, so when people change it, they would be aware of the need of changing the extra copy.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] starsz commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r633510621



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       Installed in other methods, maybe don't have `apisix.service` in the file system.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers merged pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
tokers merged pull request #4246:
URL: https://github.com/apache/apisix/pull/4246


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #4246: docs: add instruction about how to add systemd unit files

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4246:
URL: https://github.com/apache/apisix/pull/4246#discussion_r633059994



##########
File path: docs/en/latest/how-to-build.md
##########
@@ -167,3 +167,15 @@ Content-Type: text/html
 Some features require you to build OpenResty with extra Nginx modules.
 If you need those features, you can build OpenResty with
 [this build script](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh).
+
+## 7. Add systemd unit file for APISIX
+
+If you install APISIX with rpm package, the unit file is installed automatically, and you could directly do
+
+```
+$ systemctl start apisix
+$ systemctl stop apisix
+$ systemctl enable apisix
+```
+
+If installed in other methods, you could refer to [the unit file template](https://github.com/api7/apisix-build-tools/blob/master/usr/lib/systemd/system/apisix.service), modify if needed, and place it as `usr/lib/systemd/system/apisix.service`.

Review comment:
       I think you should use path in the file system, not the relative one in the build tool repo.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org