# Failed to start PBS dataservice-lock seems to be held

**URL:** <https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899>\
**Category:** Users/Site Administrators\
**Created:** [March 15, 2018, 7:34am UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899 "2018-03-15T07:34:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prabhudev](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@Prabhudev](https://community.openpbs.org/u/Prabhudev)\
**Post date:** [March 15, 2018, 7:34am UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/1 "2018-03-15T07:34:57Z")

</div>

I am getting failed to acquire lock problem.  
Someone in the forum had a similar problem and they had corrected it.  
The suggested solutions are:- 1.To clean /var folder if it is full(My /var folder is only 74% full)  
2.Few lines be added in pbspro/sbin/pbs\_dataservice to check the ownership of /var/run/postgresql.  
if it is different from the database user defined in /var/spool/pbspro/server\_priv/db\_user, the ownership should be changed accordingly.(I don’t have postgresql directory created in /var/run)  
Here is what I am getting-  
[root@host1 datastore]# service pbs restart  
Restarting PBS  
Stopping PBS  
PBS mom - was pid: 117648  
PBS sched - was pid: 117662  
PBS comm - was pid: 117614  
Waiting for shutdown to complete  
Starting PBS  
PBS comm  
/opt/pbs/sbin/pbs\_comm ready (pid=119554),Threads:4  
PBS mom  
PBS sched  
Connecting to PBS dataservice…Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 119947 running on host: host1 cannot start]  
.Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 119947 running on host: host1 - cannot start]  
.Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 119947 running on host: host1- cannot start]  
.Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 119947 running on host: host1 - cannot start]  
continuing in background.  
PBS server  
Please help me.

---

<div class="post-metadata">

**Author:** ![mkaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/mkaro/32/85_2.png) [@mkaro](https://community.openpbs.org/u/mkaro)\
**Post date:** [March 15, 2018, 3:25pm UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/2 "2018-03-15T15:25:19Z")

</div>

Looks like another instance of the database may be running. What is PID 119947?

The following command will show you processes related to PBS…  
ps -ef | grep -i pbs

Please make sure all PBS Pro processes are stopped before you try to start the service.

---

<div class="post-metadata">

**Author:** ![Prabhudev](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@Prabhudev](https://community.openpbs.org/u/Prabhudev)\
**Post date:** [March 19, 2018, 4:48am UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/3 "2018-03-19T04:48:44Z")

</div>

I stopped all pbs processes and then restarted.Everytime some other process with different pid seems to hold the lock.I have the same problem  
[root@host1 kbharadw]# sudo /etc/init.d/pbs stop  
Stopping PBS  
PBS mom - was pid: 1072123  
PBS sched - was pid: 1072137  
PBS comm - was pid: 1072085  
Waiting for shutdown to complete  
[root@host1 datastore]# ps -ef | grep -i pbs  
root 1073924 3148393 0 10:13 pts/1 00:00:00 grep --color=auto -i pbs  
[root@host1 datastore]# sudo /etc/init.d/pbs start  
Starting PBS  
PBS comm  
/opt/pbs/sbin/pbs\_comm ready (pid=1074020), Threads:4  
PBS mom  
PBS sched  
Connecting to PBS dataservice…Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 1074411 running on host: host1- cannot start]  
.Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 1074411 running on host: host1 - cannot start]  
.Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 1074411 running on host: host1 - cannot start]  
.Failed to start PBS dataservice:[Failed to acquire lock on /var/spool/pbs/datastore/pbs\_dblock. Lock seems to be held by pid: 1074411 running on host: host1 - cannot start]  
continuing in background.  
PBS server  
[root@host1 datastore]#

---

<div class="post-metadata">

**Author:** ![mkaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/mkaro/32/85_2.png) [@mkaro](https://community.openpbs.org/u/mkaro)\
**Post date:** [March 19, 2018, 5:49pm UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/4 "2018-03-19T17:49:42Z")

</div>

Please run the following command:

sudo /opt/pbs/sbin/pbs\_ds\_monitor check

Run it once with PBS running and once with PBS stopped. Please capture the return code (echo $?) and any output produced.

---

<div class="post-metadata">

**Author:** ![Source](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/source/32/756_2.png) [@Source](https://community.openpbs.org/u/Source)\
**Post date:** [March 25, 2018, 8:43am UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/5 "2018-03-25T08:43:02Z")

</div>

did you try rm /tmp/.s.postgresql.15007\*.

if theses file exists, you need to delete it manually as well as pbs\_dblock file in $PBS\_HOME/databases

Also make sure the permission of /tmp is 1777  
hope it helps

---

<div class="post-metadata">

**Author:** ![hsnsm](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/hsnsm/32/368_2.png) [@hsnsm](https://community.openpbs.org/u/hsnsm)\
**Post date:** [January 17, 2021, 8:52am UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/6 "2021-01-17T08:52:02Z")

</div>

Thank you!  
It worked by deleting the files and changing the owner of “/tmp” to root and permissions to 777.

---

<div class="post-metadata">

**Author:** ![mkaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/mkaro/32/85_2.png) [@mkaro](https://community.openpbs.org/u/mkaro)\
**Post date:** [January 17, 2021, 2:18pm UTC](https://community.openpbs.org/t/failed-to-start-pbs-dataservice-lock-seems-to-be-held/899/7 "2021-01-17T14:18:04Z")

</div>

The permissions of tmp should be 1777, rather than 0777. The “sticky bit” should be set on temporary directories.
