Fix package installation
This commit is contained in:
parent
409f7a1318
commit
9a4ea72043
|
@ -239,7 +239,6 @@ router.post('/execute', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
job = await get_job(req.body);
|
job = await get_job(req.body);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error({ error });
|
|
||||||
return res.status(400).json(error);
|
return res.status(400).json(error);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -9,4 +9,5 @@ mkdir init && \
|
||||||
echo 1 > init/cgroup.procs && \
|
echo 1 > init/cgroup.procs && \
|
||||||
echo '+cpuset +memory' > cgroup.subtree_control && \
|
echo '+cpuset +memory' > cgroup.subtree_control && \
|
||||||
echo "Initialized cgroup" && \
|
echo "Initialized cgroup" && \
|
||||||
|
chown -R piston:piston /piston && \
|
||||||
exec su -- piston -c 'ulimit -n 65536 && node /piston_api/src'
|
exec su -- piston -c 'ulimit -n 65536 && node /piston_api/src'
|
||||||
|
|
|
@ -145,7 +145,11 @@ class Package {
|
||||||
await fs.write_file(path.join(this.install_path, '.env'), filtered_env);
|
await fs.write_file(path.join(this.install_path, '.env'), filtered_env);
|
||||||
|
|
||||||
logger.debug('Changing Ownership of package directory');
|
logger.debug('Changing Ownership of package directory');
|
||||||
await util.promisify(chownr)(this.install_path, 0, 0);
|
await util.promisify(chownr)(
|
||||||
|
this.install_path,
|
||||||
|
process.getuid(),
|
||||||
|
process.getgid()
|
||||||
|
);
|
||||||
|
|
||||||
logger.debug('Writing installed state to disk');
|
logger.debug('Writing installed state to disk');
|
||||||
await fs.write_file(
|
await fs.write_file(
|
||||||
|
|
Loading…
Reference in New Issue