# Permission denied when trying to start custom app

**URL:** <https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310>\
**Category:** Get Help\
**Tags:** ondemand2, question\
**Created:** [October 11, 2022, 6:52pm UTC](https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310 "2022-10-11T18:52:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgbryant](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rgbryant/32/1025_2.png) [@rgbryant](https://discourse.openondemand.org/u/rgbryant)\
**Post date:** [October 11, 2022, 6:52pm UTC](https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310/1 "2022-10-11T18:52:41Z")

</div>

I’m running RHEL8 with OOD 2.0.1 using OHPC 2.1.

I’ve got the xfce desktop up and running with OOD so that’s good.

I’m trying to get RStudio running. I’ve got another cluster with CentOS 7 and OOD 1.6 with RStudio working. I’ve copied the app files from there and made the modifications for the match up to this new cluster.

I’m getting this in the output file:

```auto
Setting VNC password...
Starting VNC server...

Warning: compute-0.internal:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server compute-0.internal:1
Killing Xvnc process ID 421234
Xvnc process ID 421234 already killed
Xvnc did not appear to shut down cleanly. Removing /tmp/.X11-unix/X1
Xvnc did not appear to shut down cleanly. Removing /tmp/.X1-lock

Desktop 'TurboVNC: compute-0.internal:1 (foo)' started on display compute-0.internal:1

Log file is vnc.log
Successfully started VNC server on compute-0:5901...
Script starting...
Starting websocket server...
/var/spool/slurm/d/job00009/slurm_script: line 185: /users/foo/ondemand/data/sys/dashboard/batch_connect/sys/RStudio/output/35fa7141-de7f-44dd-a6f4-340d33e6d762/script.sh: Permission denied
WebSocket server settings:
  - Listen on :6015
  - No SSL/TLS support (no cert file)
  - Backgrounding (daemon)
Scanning VNC log file for user authentications...
Generating connection YAML file...
Cleaning up...
Killing Xvnc process ID 421691

```

I’ve checked the permissions on that script.sh file and the foo user owns it. Can anyone help guide me through troubleshooting this?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 11, 2022, 7:18pm UTC](https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310/2 "2022-10-11T19:18:14Z")

</div>

> [@rgbryant](#):
>
> `/var/spool/slurm/d/job00009/slurm_script: line 185: .... Permission denied`

`script.sh` is the script you’ve provided in your application. (`template/script.sh.erb`).

I’d check line 185 of that resulting script as _that line_ seems to be the issue.

---

<div class="post-metadata">

**Author:** ![rgbryant](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/rgbryant/32/1025_2.png) [@rgbryant](https://discourse.openondemand.org/u/rgbryant)\
**Post date:** [October 11, 2022, 7:40pm UTC](https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310/3 "2022-10-11T19:40:48Z")

</div>

So script.sh is actually only 34 lines.

```auto
#!/usr/bin/env bash

i#Clean the environment
module purge

# Set working directory to home directory
#cd "${HOME}"

cd /users/$(whoami)
#
# Launch Xfce Window Manager and Panel
#
(
  export SEND_256_COLORS_TO_REMOTE=1
  export XDG_CONFIG_HOME="/users/foo/ondemand/data/sys/dashboard/batch_connect/sys/RStudio/output/1179d179-1414-4c50-bebb-4ed18c597dd5/config"
  export XDG_DATA_HOME="/users/foo/ondemand/data/sys/dashboard/batch_connect/sys/RStudio/output/1179d179-1414-4c50-bebb-4ed18c597dd5/share"
  export XDG_CACHE_HOME="$(mktemp -d)"
  module restore
  set -x
  xfwm4 --compositor=off --daemon --sm-client-disable
  xsetroot -solid "#D3D3D3"
  xfsettingsd --sm-client-disable
  xfce4-panel --sm-client-disable
) &

# Start BioGrids app
source /programs/biogrids.shrc >> $HOME/ondemand.out 2>&1
export SB_SITENAME=${SB_SITENAME}-OOD
echo "Starting ondemand export RSTUDIO_X=2022.02.3; export R_X=4.1; rstudio " >> $HOME/ondemand.out 2>&1
# launch the app selected in widget
# jupyter needs runtime dir unset because user ID gets mixed up sometimes
unset XDG_RUNTIME_DIR
export RSTUDIO_X=2022.02.3; export R_X=4.1; rstudio

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [October 11, 2022, 7:50pm UTC](https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310/4 "2022-10-11T19:50:16Z")

</div>

LOL - sorry, this is much easier than I’m making it.

Set the original file `template/script.sh.erb` to executable. The file is being copied as is, so if it starts as 644 it’ll be copied as 644. It needs to be 755 (or 750 if you prefer).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [April 9, 2023, 7:50pm UTC](https://discourse.openondemand.org/t/permission-denied-when-trying-to-start-custom-app/2310/5 "2023-04-09T19:50:40Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
